/** * 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); }
/** * Construct a new Value object. * * @param array $fileData */ public function __construct(array $fileData = array()) { // BC with 5.0 (EZP-20948) if (isset($fileData['path'])) { $fileData['id'] = $fileData['path']; unset($fileData['path']); } // BC with 5.2 (EZP-22808) if (isset($fileData['id']) && file_exists($fileData['id'])) { $fileData['inputUri'] = $fileData['id']; unset($fileData['id']); } parent::__construct($fileData); }
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); }