diff options
Diffstat (limited to 'models/Post.php')
-rw-r--r-- | models/Post.php | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/models/Post.php b/models/Post.php index 411d2a0..5a8bab0 100644 --- a/models/Post.php +++ b/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; - } } - ?>
\ No newline at end of file |