Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Zend_Validate_Sitemap_Changefreq Class Reference
Inheritance diagram for Zend_Validate_Sitemap_Changefreq:
Zend_Validate_Abstract Zend_Validate_Interface

Public Member Functions

 isValid ($value)
 
- Public Member Functions inherited from Zend_Validate_Abstract
 getMessages ()
 
 getMessageVariables ()
 
 getMessageTemplates ()
 
 setMessage ($messageString, $messageKey=null)
 
 setMessages (array $messages)
 
 __get ($property)
 
 getErrors ()
 
 setObscureValue ($flag)
 
 getObscureValue ()
 
 setTranslator ($translator=null)
 
 getTranslator ()
 
 hasTranslator ()
 
 setDisableTranslator ($flag)
 
 translatorIsDisabled ()
 

Data Fields

const NOT_VALID = 'sitemapChangefreqNotValid'
 
const INVALID = 'sitemapChangefreqInvalid'
 

Protected Attributes

 $_messageTemplates
 
 $_changeFreqs
 
- Protected Attributes inherited from Zend_Validate_Abstract
 $_value
 
 $_messageVariables = array()
 
 $_messageTemplates = array()
 
 $_messages = array()
 
 $_obscureValue = false
 
 $_errors = array()
 
 $_translator
 
 $_translatorDisabled = false
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Validate_Abstract
static setDefaultTranslator ($translator=null)
 
static getDefaultTranslator ()
 
static hasDefaultTranslator ()
 
static getMessageLength ()
 
static setMessageLength ($length=-1)
 
- Protected Member Functions inherited from Zend_Validate_Abstract
 _createMessage ($messageKey, $value)
 
 _implodeRecursive (array $pieces)
 
 _error ($messageKey, $value=null)
 
 _setValue ($value)
 
- Static Protected Attributes inherited from Zend_Validate_Abstract
static $_defaultTranslator
 
static $_messageLength = -1
 

Detailed Description

Definition at line 39 of file Changefreq.php.

Member Function Documentation

◆ isValid()

isValid (   $value)

Validates if a string is valid as a sitemap changefreq

http://www.sitemaps.org/protocol.php#changefreqdef

Parameters
string$valuevalue to validate
Returns
boolean

Implements Zend_Validate_Interface.

Definition at line 76 of file Changefreq.php.

77  {
78  if (!is_string($value)) {
79  $this->_error(self::INVALID);
80  return false;
81  }
82 
83  $this->_setValue($value);
84  if (!is_string($value)) {
85  return false;
86  }
87 
88  if (!in_array($value, $this->_changeFreqs, true)) {
89  $this->_error(self::NOT_VALID);
90  return false;
91  }
92 
93  return true;
94  }
_error($messageKey, $value=null)
Definition: Abstract.php:284
$value
Definition: gender.phtml:16

Field Documentation

◆ $_changeFreqs

$_changeFreqs
protected
Initial value:
= array(
'always', 'hourly', 'daily', 'weekly',
'monthly', 'yearly', 'never'
)

Definition at line 63 of file Changefreq.php.

◆ $_messageTemplates

$_messageTemplates
protected
Initial value:
= array(
self::NOT_VALID => "'%value%' is not a valid sitemap changefreq",
self::INVALID => "Invalid type given. String expected",
)

Definition at line 53 of file Changefreq.php.

◆ INVALID

const INVALID = 'sitemapChangefreqInvalid'

Definition at line 46 of file Changefreq.php.

◆ NOT_VALID

const NOT_VALID = 'sitemapChangefreqNotValid'

Validation key for not valid

Definition at line 45 of file Changefreq.php.


The documentation for this class was generated from the following file: