コード例 #1
0
ファイル: MenuRepository.php プロジェクト: rutgerkok/rCMS
 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;
 }
コード例 #2
0
ファイル: CommentRepository.php プロジェクト: rutgerkok/rCMS
 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;
 }
コード例 #3
0
ファイル: ArticleRepository.php プロジェクト: rutgerkok/rCMS
 protected function canBeSaved(Entity $article)
 {
     if (!$article instanceof Article) {
         return false;
     }
     return parent::canBeSaved($article) && $article->isComplete();
 }
コード例 #4
0
ファイル: LinkRepository.php プロジェクト: rutgerkok/rCMS
 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;
 }
コード例 #5
0
ファイル: DocumentRepository.php プロジェクト: rutgerkok/rCMS
 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());
 }