diff options
author | Michael Francis <edude03@gmail.com> | 2011-07-10 22:07:55 -0400 |
---|---|---|
committer | Michael Francis <edude03@gmail.com> | 2011-07-10 22:07:55 -0400 |
commit | 85ed7ec89ae31412f2e6c35cfe437864b6cef528 (patch) | |
tree | 48043388d2964c5f5807d97f515d7316bb3b8cab | |
parent | eaa0bfb68939734c42fde8c61ac399e2cc1e016a (diff) | |
download | otakuhub-85ed7ec89ae31412f2e6c35cfe437864b6cef528.tar.xz |
Removed mongo code
-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 |