소스 검색

Removed mongo code

Michael Francis 14 년 전
부모
커밋
85ed7ec89a
1개의 변경된 파일1개의 추가작업 그리고 40개의 파일을 삭제
  1. 1 40
      models/Post.php

+ 1 - 40
models/Post.php

@@ -51,8 +51,7 @@ class Post extends \lithium\data\Model {
  	}
 	
 	//TODO: Some sort of security check to make sure 
-			//That the user is ok with receiving message
-
+	//That the user is ok with receiving message
 	public function directMessage($entity, $to)
 	{
 		//Get the user the message is to
@@ -97,43 +96,5 @@ class Post extends \lithium\data\Model {
 		//Formats the string and returns it.
 		return "<a class=\"mention\" href=\"/profile/view/$output\">$input</a>";
 	}
-
-	/**
-	* Stores the post to all the user's friends feed 
-	* @param Post $entity The post to be stored
-	* @param Array $users an Array of users objects to store the post to
-	* @return boolean True if sucsessful, false otherwise 
-	*/
-	//Store all can take a single param as well, therefore it should replace the store method once we're sure it works properly :TODO:
-	public function storeAll($entity, $users)
-	{
-		$ids; 
-		foreach($users as $user)
-		{
-			$ids[] = $user->_id;
-		}
-
-		$updateData = array('$push' => array('feed' =>  $entity['_id']->__toString()));
-
-		$conditions =  array('_id' => array('$in' => $ids));
-		$result = User::update($updateData, $conditions, array('atomic' => false));
-
-		return $result; 
-	}
-
-	/**
-	 * Stores the post to the database
-	 * @param Post $entity The post to store.
-	 * @param User $user The user to store the post to. 
-	 */ 
-	public function store($entity, $user)
-	{
-		$updateData = array('$push' => array('feed' =>  $entity['_id']->__toString()));
-		$conditions =  array('_id' => $user['_id']);
-		$result = User::update($updateData, $conditions, array('atomic' => false));
-
-		return $result; 
-	}
 }
-
 ?>