public function check() { if (!$this->required && !$this->value) { return; } $error = parent::check(); if ($error) { return $error; } if ((int) $this->value != $this->value) { return array('integer', $this->printName()); } return; }
public function __toString() { $languages = c::get('languages'); $lang = $currentLang = strtoupper(site()->language()->code()); foreach ($languages as $l) { if (isset($l['default']) && $l['default']) { $lang = strtoupper($l['code']); } } if ($currentLang == $lang) { return parent::__toString(); } return ""; }
/** * {@inheritDoc} */ public function getData() { return (int) parent::getData(); }