private function controlNodeContent($name, $value) { if (FeedValidator::isNull($value) == FALSE) { switch (strtolower($name)) { case 'start': case 'published': case 'updated': return FeedValidator::isValidDate(FeedWriter::getISODate($value)); break; case 'name': return FeedValidator::isNull($value) == FALSE ? TRUE : FALSE; break; case 'email': return FeedValidator::isValidEmail($value); break; case 'logo': case 'icon': case 'uri': return FeedValidator::isValidURL($value); break; case 'latitude': return FeedValidator::isValidLatitude($value); break; case 'longitude': return FeedValidator::isValidLongitude($value); break; case 'country_code': return FeedValidator::isValidCountryCode($value); break; case 'currency': return FeedValidator::isValidCurrency($value); break; default: return TRUE; break; } } return TRUE; }
/** * Set the 'updated' channel element * * @access public * @see http://essfeed.org/index.php/ESS_structure * * @param String Value of 'updated' channel tag. * Must be an UTC Date format (ISO 8601). * e.g. 2013-10-31T15:30:59Z in Paris or 2013-10-31T15:30:59+0800 in San Francisco * @return void */ public function setUpdated($el = 'now') { $elNane = 'updated'; if (self::controlChannelElements($elNane, $el)) { $this->setChannelElement('updated', FeedWriter::getISODate($el)); } else { throw new Exception("Error: '< channel >< {$elNane}>' XML element, if it is defined, can not be empty."); } }