Example #1
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $options)
 {
     $options->name = 'ninjaboard_user_groups';
     $options->identity_column = 'ninjaboard_user_group_id';
     $options->behaviors = array('orderable');
     parent::__construct($options);
 }
Example #2
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     $config->name = 'ninjaboard_subscriptions';
     $config->identity_column = 'ninjaboard_subscription_id';
     $config->behaviors = array('creatable');
     parent::__construct($config);
 }
Example #3
0
    protected function  _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'relation_table' => 'docman_category_relations',
            'behaviors'      => array(
                'permissible',
                'lockable',
                'sluggable',
                'creatable',
                'modifiable',
                'identifiable',
                'orderable',
                'parameterizable',
                'nestable'     => array('relation_table' => 'docman_category_relations')
            ),
            'column_map' => array(
                'parameters' => 'params'
            ),
            'filters'        => array(
                'parameters'  => array('json'),
                'title'       => array('trim'),
                'slug'        => array('trim'),
                'description' => array('trim', 'html')
            )
        ));

        parent::_initialize($config);
    }
Example #4
0
    protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'permissible',
                'lockable',
                'creatable',
                'modifiable',
                'sluggable',
                'identifiable',
                'hittable',
                'parameterizable',
                'timezonable' => array('fields' => array('publish_on', 'unpublish_on'))
            ),
            'column_map' => array(
                'parameters' => 'params',
                'touched_on' => 'GREATEST(tbl.created_on, tbl.modified_on)'
            ),
            'filters' => array(
                'parameters'   => array('json'),
                'title'        => array('trim'),
                'slug'         => array('trim'),
                'storage_type' => array('com://admin/docman.filter.identifier'),
                'description'  => array('trim', 'html')
            )
        ));

        parent::_initialize($config);
    }
Example #5
0
 /**
  * Drops all translated copies of the table, as well as all nodes
  */
 public function delete($wheres)
 {
     $nooku = KFactory::get('admin::com.nooku.model.nooku');
     $nodes = KFactory::get('admin::com.nooku.table.nodes');
     $languages = $nooku->getAddedLanguages();
     foreach ($wheres as $where) {
         $table_name = KFactory::get('admin::com.nooku.table.tables')->find($where)->get('table_name');
         // Delete all items for this table from the nodes table
         $query = $this->_db->getQuery()->where('table_name', '=', $table_name);
         $nodes->delete($query);
         if ($err = $nodes->getError()) {
             //throw new KDatabaseTableException($err);
         }
         // Delete all #__isocode_table_name
         foreach ($languages as $language) {
             $query = 'DROP TABLE ' . $this->_db->quoteName('#__' . strtolower($language->iso_code) . '_' . $table_name);
             $this->_db->execute($query);
             if ($err = $this->_db->getError()) {
                 //throw new KDatabaseTableException($err);
             }
         }
     }
     // Delete the table item in nooku_tables
     return parent::delete($wheres);
 }
Example #6
0
 /**
  * Filter the data, 'text' is a raw Column (because only administrators use this)
  */
 public function filter($data)
 {
     settype($data, 'array');
     //force to array
     if ($data['text']) {
         $this->getColumn('text')->filter = KFactory::tmp('lib.koowa.filter.raw');
     }
     return parent::filter($data);
 }
Example #7
0
 public function update($data, $rows = null)
 {
     // we didn't get the id of the log item, so we find it ourselves
     if (!$rows) {
         $params = array('iso_code' => $data['iso_code'], 'table_name' => $data['table_name'], 'row_id' => $data['row_id']);
         $rows = (array) $this->findByConditions($params)->nooku_node_id;
     }
     return parent::update($data, $rows);
 }
Example #8
0
 public function insert($data)
 {
     $this->_db->select('SELECT picman_tag_id FROM #__picman_tags WHERE tag=' . $this->_db->quote($data['tag']));
     if ($id = $this->_db->loadResult()) {
         // the tag already exists
         $this->set('id', $id);
         return true;
     }
     $ret = parent::insert($data);
     $this->set('id', $this->_db->insertid());
     return $ret;
 }
Example #9
0
	protected function _initialize(KObjectConfig $config)
	{
		$config->append(array(
			'filters' => array(
				'slug' 				 => 'cmd',
				'path'               => 'com:files.filter.path',
				'parameters'         => 'json'
			),
			'behaviors' => array(
                'lib:database.behavior.sluggable' => array('columns' => array('id', 'title')),
                'parameterizable'
            )
		));

		parent::_initialize($config);
	}
Example #10
0
 /**
  * Initializes the options for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KObjectConfig $config Configuration options.
  */
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'activities', 'behaviors' => array('creatable', 'identifiable', 'parameterizable' => array('column' => 'metadata')), 'filters' => array('metadata' => 'json')));
     parent::_initialize($config);
 }
Example #11
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'articles_articles', 'behaviors' => array('identifiable', 'sluggable', 'orderable', 'lockable', 'creatable', 'modifiable', 'com://admin/translations.database.behavior.translatable')));
     parent::_initialize($config);
 }
Example #12
0
 /**
  * Object constructor to set table and key field
  *
  * @param	array 	An optional associative array of configuration settings.
  */
 public function __construct(array $options = array())
 {
     //Force the table to use the core content table
     $options['table_name'] = 'content';
     parent::__construct($options);
 }
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('behaviors' => array('modifiable', 'creatable'), 'filters' => array()));
     parent::_initialize($config);
 }
Example #14
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('behaviors' => array('com:comments.database.behavior.commentable'), 'filters' => array('description' => array('trim', 'html'))));
     parent::_initialize($config);
 }
Example #15
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     $config->name = 'ninjaboard_user_group_maps';
     parent::__construct($config);
 }
Example #16
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $options)
 {
     $options->name = 'ninjaboard_assets';
     $options->identity_column = 'ninjaboard_asset_id';
     parent::__construct($options);
 }
Example #17
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $options)
 {
     $options->name = 'users';
     parent::__construct($options);
 }
Example #18
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'users'));
     parent::_initialize($config);
 }
Example #19
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'articles_articles', 'behaviors' => array('com://admin/translations.database.behavior.translatable')));
     parent::_initialize($config);
 }
Example #20
0
 protected function _initialize(KConfig $config)
 {
     $timezonable = $this->getBehavior('timezonable')->setFields(array('publish_on', 'unpublish_on'));
     $config->append(array('command_chain' => $this->getService('com://admin/docman.command.chain'), 'behaviors' => array('aclable', 'configurable', 'lockable', 'creatable', 'modifiable', 'sluggable', 'identifiable', $timezonable), 'filters' => array('storage_type' => array('com://admin/docman.filter.identifier'), 'description' => array('html'))));
     parent::_initialize($config);
 }
Example #21
0
 /**
  * Drops all tables for the language, as well as all nodes
  */
 public function delete($wheres)
 {
     $nooku = KFactory::get('admin::com.nooku.model.nooku');
     $nodes = KFactory::get('admin::com.nooku.table.nodes');
     $tables = $nooku->getTables();
     $primary = $nooku->getPrimaryLanguage();
     foreach ($wheres as $key => $where) {
         $iso_code = KFactory::get('admin::com.nooku.table.languages')->find($where)->get('iso_code');
         // the primary language can't be deleted
         if ($primary->iso_code == $iso_code) {
             unset($wheres[$key]);
             JError::raiseNotice(0, "The primary language can't be deleted");
             if (count($wheres)) {
                 continue;
             } else {
                 return true;
             }
         }
         // Delete all items for this lang from the nodes table
         $query = $this->_db->getQuery()->where('iso_code', '=', $iso_code);
         $nodes->delete($query);
         // Delete all #__isocode_table_name
         foreach ($tables as $table) {
             $query = 'DROP TABLE ' . $this->_db->quoteName('#__' . strtolower($iso_code) . '_' . $table->table_name);
             $this->_db->execute($query);
         }
     }
     // Delete the table item in nooku_tables
     return parent::delete($wheres);
 }
Example #22
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('behaviors' => array('identifiable', 'creatable', 'modifiable', 'parameterizable' => array('column' => 'conditions')), 'filters' => array('conditions' => array('json'))));
     parent::_initialize($config);
 }
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('identity_column' => 'docman_category_id'));
     parent::_initialize($config);
 }
 public function __construct(KConfig $options)
 {
     $options->name = 'plugins';
     $options->identity_column = 'id';
     parent::__construct($options);
 }
Example #25
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('column_map' => array('container' => 'files_container_id'), 'behaviors' => array('identifiable', 'creatable', 'modifiable', 'lockable')));
     parent::_initialize($config);
 }
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('behaviors' => array('orderable', 'lib:database.behavior.modifiable', 'identifiable', 'parameterizable' => array('column' => 'state')), 'filters' => array('state' => 'json')));
     parent::_initialize($config);
 }
Example #27
0
 /**
  * Truncates tables that data is being imported to
  *
  * @author Stian Didriksen <*****@*****.**>
  * @param  KDatabaseTableAbstract $table	The table being deleted
  * @return $this
  */
 protected function _truncateTable(KDatabaseTableAbstract $table)
 {
     $name = $table->getBase();
     //If this table have been truncated ebfore, don't truncate it again
     if (isset($this->trunctated[$name])) {
         return $this;
     }
     $sql = 'TRUNCATE TABLE ' . $table->getDatabase()->quoteName('#__' . $name);
     //Execute the query
     $table->getDatabase()->execute($sql);
     //Update the trunctated array
     $this->trunctated[$name] = true;
     return $this;
 }
Example #28
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'languages', 'base' => 'languages', 'identity_column' => 'lang_id'));
     parent::_initialize($config);
 }
Example #29
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('behaviors' => array('permissible', 'lockable', 'creatable', 'modifiable', 'sluggable', 'identifiable', 'parameterizable'), 'filters' => array('title' => array('trim'), 'slug' => array('trim'), 'description' => array('trim', 'html'))));
     parent::_initialize($config);
 }
Example #30
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('behaviors' => 'creatable', 'filters' => array('manifest' => 'com://admin/extman.filter.manifest', 'identifier' => 'com://admin/extman.filter.identifier')));
     parent::_initialize($config);
 }