/** * Defined by Zend_Validate_Interface * * Returns true if and only if $value doesn't exist already as page name * * @param string $value * @return boolean */ public function isValid($value) { $value = (string) $value; $this->_setValue($value); $mdlPage = new Model_Page(); if ($mdlPage->pagenameExists($value, $this->getExclude())) { $this->_error(self::EXISTS); return false; } if ('admin' == strtolower($value)) { $this->_error(self::ISADMIN); return false; } if ('public' == strtolower($value)) { $this->_error(self::ISPUBLIC); return false; } return true; }
/** * Defined by Zend_Validate_Interface * * Returns true if and only if $value does exist already as page name * * @param string $value * @return boolean */ public function isValid($value) { $value = (string) $value; $this->_setValue($value); $mdlPage = new Model_Page(); if ($mdlPage->pagenameExists($value, $this->getExclude())) { return true; } $this->_error(self::NOT_EXISTS); return false; }