Example #1
0
    public function toArray()
    {
        $data = parent::toArray();
        $data['hierarchy_title'] = $this->hierarchy_title;

        return $data;
    }
Example #2
0
 public function toArray()
 {
     $data = parent::toArray();
     unset($data['_thumbnail_size']);
     unset($data['source']);
     return $data;
 }
Example #3
0
	public function toArray()
	{
		$data = parent::toArray();
        $data['relative_path'] = $this->getProperty('relative_path');
		$data['parameters']    = $this->getParameters()->toArray();

		return $data;
	}
Example #4
0
 public function toArray()
 {
     $data = parent::toArray();
     $data['relative_path'] = $this->getProperty('relative_path');
     $data['parameters'] = $this->getParameters()->toArray();
     $data['server_upload_limit'] = static::getServerUploadLimit();
     return $data;
 }
Example #5
0
 /**
  * @param string $name
  * @param mixed $value
  * @param bool $modified
  * @return $this
  */
 public function setProperty($name, $value, $modified = true)
 {
     parent::setProperty($name, $value, $modified = true);
     if ($name === 'all_day') {
         $this->allDay = (bool) $this->{$name};
         $this->color = '#ff00ff';
     }
     return $this;
 }
Example #6
0
 public function save()
 {
     $conditions = $this->getConditions()->toArray();
     $conditions = $this->array_filter_recursive($conditions);
     array_walk_recursive($conditions, function (&$value) {
         if (is_numeric($value)) {
             $value = (int) $value;
         }
     });
     $this->getConditions()->merge($conditions);
     return parent::save();
 }
Example #7
0
 public function toArray()
 {
     $data = parent::toArray();
     $file = $this->file;
     if (!$file->isNew()) {
         $data['file'] = $file->toArray();
         if ($file->isThumbnail()) {
             $thumbnail = $file->getThumbnail();
             $data['thumbnail'] = !$thumbnail->isNew() ? $thumbnail->thumbnail : false;
         }
         $data['file'] = $file->toArray();
     }
     $data['created_on_timestamp'] = strtotime($this->created_on);
     $data['attached_on_timestamp'] = strtotime($this->attached_on);
     return $data;
 }
Example #8
0
 public function toArray()
 {
     $data = parent::toArray();
     $data['group_list'] = $this->getGroups();
     return $data;
 }
Example #9
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('auto_load' => true));
     parent::_initialize($config);
 }
Example #10
0
 /**
  * Prevent removing the package property.
  *
  * @param string $name The property name.
  *
  * @throws RuntimeException When attempting to remove the package property.
  * @return KDatabaseRowAbstract
  */
 public function removeProperty($name)
 {
     if ($name == 'package') {
         throw new RuntimeException('Entity package property cannot be removed.');
     }
     return parent::removeProperty($name);
 }
Example #11
0
 /**
  * Excludes private fields from JSON representation
  *
  * @return array
  */
 public function toArray()
 {
     $data = parent::toArray();
     $data = array_intersect_key($data, $this->_fields);
     return $data;
 }
Example #12
0
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->details = array();
 }
Example #13
0
 public function delete()
 {
     $this->_setCoreExtension(false);
     $client_id = $this->type == 'component' ? 1 : 0;
     $result = $this->getInstaller()->uninstall($this->type, $this->joomla_extension_id, $client_id);
     if ($result) {
         $result = parent::delete();
     }
     if ($result) {
         // Uninstall dependencies (if they are dependent to this extension only)
         foreach ($this->getDependents() as $dependency) {
             $count = $this->getObject('com://admin/extman.model.dependencies')->dependent_id($dependency->dependent_id)->count();
             if ($count === 1) {
                 $extension = $this->getObject('com://admin/extman.model.extensions')->id($dependency->dependent_id)->fetch();
                 $extension->delete();
             }
             $dependency->delete();
         }
     }
     return $result;
 }
Example #14
0
 public function getProperty($name)
 {
     if ($name === 'alias') {
         return isset($this->_data['alias']) ? $this->_data['alias'] : $this->id . '-' . $this->slug;
     }
     return parent::getProperty($name);
 }