/** * Gets the state of the entry * @return null */ public function getEntryState() { $entryState = parent::getEntryState(); if ($entryState !== self::STATE_CLEAN || isset($this->checkEntryState)) { return $entryState; } $this->checkEntryState = true; $entryState = null; if (!$entryState && $this->entry && $this->entry->getEntryState() !== self::STATE_CLEAN) { $entryState = self::STATE_DIRTY; } if (!$entryState && $this->posts) { foreach ($this->posts as $value) { if ($value->getEntryState() !== self::STATE_CLEAN) { $entryState = self::STATE_DIRTY; break; } } } if (!$entryState) { $entryState = self::STATE_CLEAN; } unset($this->checkEntryState); return $entryState; }
/** * Gets the state of the entry * @return null */ public function getEntryState() { $entryState = parent::getEntryState(); if ($entryState !== self::STATE_CLEAN || isset($this->checkEntryState)) { return $entryState; } $this->checkEntryState = true; $entryState = null; if (!$entryState && $this->author && $this->author->getEntryState() !== self::STATE_CLEAN) { $entryState = self::STATE_DIRTY; } if (!$entryState) { $entryState = self::STATE_CLEAN; } unset($this->checkEntryState); return $entryState; }