Beispiel #1
0
 public function getItem()
 {
     if (!isset($this->_item)) {
         $this->_item = $this->getService('com://admin/docman.database.row.remote', array('data' => array('path' => $this->_state->path)));
     }
     return parent::getItem();
 }
Beispiel #2
0
 public function getItem()
 {
     if (!$this->_item) {
         $this->_item = $this->getService('com://admin/docman.database.row.config');
     }
     return parent::getItem();
 }
 public function getItem()
 {
     if (!isset($this->_item)) {
         if ($this->_state->isUnique()) {
             $state = $this->_state;
             //Get application information
             $client = JApplicationHelper::getClientInfo($state->application, true);
             if (!empty($client)) {
                 //Get the path
                 $default = JComponentHelper::getParams('com_extensions')->get('language_' . $client->name, 'en-GB');
                 if ($state->default) {
                     $state->language = $default;
                 }
                 $path = $client->path . '/language/' . $state->name;
                 //Create the row
                 $data = array('path' => $path, 'application' => $client->name);
                 $row = $this->getService('com://admin/extensions.database.row.language', array('data' => $data));
                 $row->default = $row->language == $default;
                 $this->_item = $row;
             } else {
                 throw new KModelException('Invalid application');
             }
         }
     }
     return parent::getItem();
 }
Beispiel #4
0
 /**
  * Get a package
  *
  * @return  object
  */
 public function getItem()
 {
     if (!isset($this->_item)) {
         $this->_item = $this->_state->file;
         if ($this->_state->folder) {
             $this->_item = $this->_state->folder;
         }
     }
     return parent::getItem();
 }
Beispiel #5
0
    protected function _getItem(KModelAbstract $model)
    {
        $row = $model->getItem();

        $output = new stdclass;
        $output->status = $row->getStatus() !== KDatabase::STATUS_FAILED && $row->path;

        if ($output->status !== false){
            $output->item = $row->toArray();
        } else {
            $output->error = $row->getStatusMessage();
        }

        return $output;
    }
Beispiel #6
0
 /**
  * Method to get a item object which represents a table row
  *
  * @return  object KDatabaseRow
  */
 public function getItem()
 {
     // Get the data if it doesn't already exist
     if (!isset($this->_item)) {
         $this->_item = $this->getTable()->find((int) $this->getState('id'));
     }
     return parent::getItem();
 }
 /**
  * Method to get a item object which represents a table row
  *
  * @return Item
  */
 public function getItem()
 {
     // Get the data if it doesn't already exist
     if (!isset($this->_item)) {
         if ($this->_state->id) {
             foreach ($this->_filterItems() as $item) {
                 if ($item->name != $this->_state->id) {
                     continue;
                 }
                 $template = $item;
             }
             $this->_item = $template;
         } else {
             $this->_item = current($this->_filterItems());
         }
     }
     return parent::getItem();
 }