public function addRestrictedPermissions($restrictedPermissions) { if ($restrictedPermissions instanceof Zend_Config) { $restrictedPermissions = $restrictedPermissions->toArray(); } if (is_string($restrictedPermissions)) { $restrictedPermissions = Webbers_Util::explode($restrictedPermissions); } if (is_array($restrictedPermissions)) { $this->_restrictedPermissions = $restrictedPermissions; } return $this; }
/** * Defined by Zend_Validate_Interface * * Returns true if and only if $value matches against the pattern option * * @param string $value * @throws Zend_Validate_Exception if there is a fatal error in pattern matching * @return boolean */ public function isValid($value) { $this->_setValue($value); $dates = Webbers_Util::explode($value, ':'); $this->_parts = count($dates); if ($this->_parts < 2) { $this->_error(self::TOO_LITTLE_PARTS); return false; } if ($this->_parts > 2) { $this->_error(self::TOO_MANY_PARTS); return false; } return parent::isValid($dates[0] . ',' . $dates[1]); }
/** * Defined by Zend_Validate_Interface * * Returns true if and only if $value matches against the pattern option * * @param string $value * @throws Zend_Validate_Exception if there is a fatal error in pattern matching * @return boolean */ public function isValid($value) { $dates = Webbers_Util::explode($value); $valid = true; $messages = array(); $errors = array(); foreach ($dates as $date) { $currentValid = parent::isValid($date); $valid &= $currentValid; if ($currentValid) { continue; } $messages += $this->getMessages(); $errors += $this->getErrors(); } if ($valid) { return true; } $this->_setValue($value); $this->_error(self::INCORRECT_DATE_IN_LIST); $this->_errors += $errors; $this->_messages += $messages; return false; }
public function setAttribsKeys($keys) { if (is_string($keys)) { $keys = Webbers_Util::explode($keys); } elseif ($keys instanceof Zend_Config) { $keys = $keys->toArray(); } $this->_attribsKeys = (array) $keys; return $this; }