Beispiel #1
0
 public function getProperty($name)
 {
     if ($name == 'contents' && !isset($this->_data['contents'])) {
         $url = $this->file;
         $response = $this->_fetch($url);
         $this->_data['contents'] = $response;
     }
     return parent::getProperty($name);
 }
Beispiel #2
0
 public function getProperty($column)
 {
     $result = parent::getProperty($column);
     if (in_array($column, array('allowed_extensions', 'allowed_mimetypes'))) {
         if ($result instanceof KObjectConfigInterface) {
             return $result->toArray();
         } elseif (!is_array($result)) {
             return array();
         }
     }
     // Disable thumbnails if these cannot be generated.
     if ($column == 'thumbnails' && $result) {
         $result = $this->thumbnailsAvailable();
     }
     return $result;
 }
Beispiel #3
0
    public function toArray()
    {
        $data = parent::toArray();

        unset($data['csrf_token']);
        unset($data['action']);
        unset($data['option']);
        unset($data['format']);
        unset($data['view']);

		$data['container'] = $this->getContainer()->slug;
		$data['type'] = $this->getIdentifier()->name;

        return $data;
    }
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('identity_key' => 'identifier'));
     parent::_initialize($config);
 }