protected function canBeSaved(Entity $menu) { if (!$menu instanceof Menu) { return false; } return parent::canBeSaved($menu) && strLen($menu->getName()) > 0 && strLen($menu->getName()) <= self::NAME_MAX_LENGTH; }
protected function canBeSaved(Entity $comment) { if (!$comment instanceof Comment) { return false; } return parent::canBeSaved($comment) && strLen($comment->getBodyRaw()) >= Comment::BODY_MIN_LENGTH && strLen($comment->getBodyRaw()) <= Comment::BODY_MAX_LENGTH; }
protected function canBeSaved(Entity $article) { if (!$article instanceof Article) { return false; } return parent::canBeSaved($article) && $article->isComplete(); }
protected function canBeSaved(Entity $link) { if (!$link instanceof Link) { return false; } return parent::canBeSaved($link) && ($link->getMenuId() > 0 || $link->getId() > 0) && strLen($link->getUrl()) <= self::MAX_URL_LENGTH && strLen($link->getText()) <= self::MAX_LINK_TEXT_LENGTH; }
protected function canBeSaved(Entity $document) { if (!$document instanceof Document) { return false; } return parent::canBeSaved($document) && !$document->isForWidgetArea() && Document::isValidIntro($document->getIntro()) && Document::isValidTitle($document->getTitle()); }