/** * Value constructor. * * Can pass in the json encoded string of selected classes. Or the correctly formed * params array. * * E.G. array( 'classes' => array( 'identifier_1', 'identifier_2' ) ) * * @param array $params */ public function __construct($params = array()) { if (!is_array($params)) { $params = array('classes' => json_decode($params)); } parent::__construct($params); }
public function __isset($propertyName) { if ($propertyName == 'path') { return true; } return parent::__isset($propertyName); }
public function __construct(array $values = array()) { parent::__construct($values); $this->media_tags = explode(',', $this->media_tag_string); }
public function __construct($values = array()) { parent::__construct($values); $this->rounded_average = intval($this->rating_average * 2 + 0.5) / 2; $this->rating = round($this->rating_average, 1); }
protected function checkValueStructure(CoreValue $value) { if ($value->__toString() === '') { throw new InvalidArgumentValue('$value->id', 'empty', $value->__toString()); } }