示例#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);
 }
示例#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);
 }
示例#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);
    }
示例#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);
    }
示例#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);
 }
示例#6
0
文件: posts.php 项目: raeldc/com_blog
 /**
  * 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);
 }
示例#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);
 }
示例#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;
 }
示例#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);
	}
示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#17
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $options)
 {
     $options->name = 'users';
     parent::__construct($options);
 }
示例#18
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'users'));
     parent::_initialize($config);
 }
示例#19
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'articles_articles', 'behaviors' => array('com://admin/translations.database.behavior.translatable')));
     parent::_initialize($config);
 }
示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#24
0
 public function __construct(KConfig $options)
 {
     $options->name = 'plugins';
     $options->identity_column = 'id';
     parent::__construct($options);
 }
示例#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);
 }
示例#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;
 }
示例#28
0
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('name' => 'languages', 'base' => 'languages', 'identity_column' => 'lang_id'));
     parent::_initialize($config);
 }
示例#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);
 }
示例#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);
 }