Example #1
0
 /**
  * @param \ride\application\orm\entry\PostEntry $post 
  * @return null
  */
 public function setPost(AliasPostEntry $post = NULL)
 {
     $isClean = false;
     if (!$this->post && !$post || $this->post && $post && $this->post->getId() === $post->getId()) {
         $isClean = true;
     }
     $this->post = $post;
     if (!$isClean && $this->entryState === self::STATE_CLEAN) {
         $this->entryState = self::STATE_DIRTY;
     }
 }
Example #2
0
 /**
  * @param \ride\application\orm\entry\PostEntry $entry 
  * @return null
  */
 public function removeFromPosts(AliasPostEntry $entry)
 {
     $this->getPosts();
     $status = false;
     foreach ($this->posts as $postsIndex => $postsValue) {
         if ($postsValue === $entry || $postsValue->getId() === $entry->getId()) {
             unset($this->posts[$postsIndex]);
             $status = true;
             break;
         }
     }
     if ($status && $this->entryState === self::STATE_CLEAN) {
         $this->entryState = self::STATE_DIRTY;
     }
     return $status;
 }
 /**
  * @param \ride\application\orm\entry\PostEntry $post 
  * @return null
  */
 public function setPost(PostEntry $post = NULL)
 {
     if (!isset($this->loadedFields['post'])) {
         $this->loadProperties();
     }
     $oldValue = null;
     if (array_key_exists('post', $this->loadedValues)) {
         $oldValue = $this->loadedValues['post'];
     }
     if (!$oldValue && !$post || $oldValue && $post && $oldValue->getId() === $post->getId()) {
         $this->post = $post;
         return;
     }
     return parent::setPost($post);
 }
Example #4
0
 /**
  * @return \ride\application\orm\entry\AuthorEntry
  */
 public function getAuthor()
 {
     if (!isset($this->loadedFields['author'])) {
         $this->loadProperties();
     }
     return parent::getAuthor();
 }