function save($value = null) { if ($value == 'on') { $value = true; } else { $value = false; } parent::save($value); }
function validate(array $def) { if (!array_key_exists('size', $def)) { throw new \ErrorException("Image property definition in type '{$this->app->controller->type}' is missing required property 'size'"); } if (!array_key_exists('default', $def['size'])) { throw new \ErrorException("Image property definition in type '{$this->app->controller->type}' is missing required default size"); } return parent::validate($def); }
function getValue($args = null) { $value = parent::getValue($args); if (!empty($value)) { $date = $value['date']; if (!empty($value['time'])) { $date .= " {$value['time']}"; } $timezone = new \DateTimeZone("Europe/Stockholm"); $value = new \DateTime($date, $timezone); } return $value; }
function load($groupId, $groupIndex, $definition, $postId) { parent::load($groupId, $groupIndex, $definition, $postId); }
function load($groupId, $groupIndex, $definition, $postId) { parent::load($groupId, $groupIndex, $definition, $postId); $this->loadDatasource($this->definition['datasource']); }