本文整理汇总了PHP中KDatabaseTableDefault类的典型用法代码示例。如果您正苦于以下问题:PHP KDatabaseTableDefault类的具体用法?PHP KDatabaseTableDefault怎么用?PHP KDatabaseTableDefault使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KDatabaseTableDefault类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
public function _initialize(KConfig $config)
{
$config->identity_column = 'id';
$config->append(array(
'name' => 'content',
'behaviors' => array(
'creatable', 'modifiable', 'lockable', 'orderable', 'sluggable', 'revisable'
),
'column_map' => array(
'locked_on' => 'checked_out_time',
'locked_by' => 'checked_out',
'slug' => 'alias',
'section_id' => 'sectionid',
'category_id' => 'catid',
'created_on' => 'created',
'modified_on' => 'modified',
'description' => 'metadesc',
'params' => 'attribs'
),
'filters' => array(
'introtext' => array('html', 'tidy'),
'fulltext' => array('html', 'tidy'),
'attribs' => 'ini'
)
));
parent::_initialize($config);
}
示例2: _initialize
public function _initialize(KConfig $config)
{
$config->identity_column = 'id';
$orderable = $this->getBehavior('com://admin/categories.database.behavior.orderable', array('parent_column' => 'section_id'));
$config->append(array('name' => 'categories', 'behaviors' => array('lockable', $orderable, 'sluggable', 'cascadable'), 'column_map' => array('enabled' => 'published', 'locked_on' => 'checked_out_time', 'locked_by' => 'checked_out', 'slug' => 'alias', 'section_id' => 'section')));
parent::_initialize($config);
}
示例3: _initialize
public function _initialize(KConfig $config)
{
$config->identity_column = 'id';
$orderable = $this->getBehavior('com://admin/categories.database.behavior.orderable', array('parent_column' => 'catid'));
$config->append(array('name' => 'weblinks', 'base' => 'weblinks', 'behaviors' => array('lockable', $orderable, 'sluggable'), 'column_map' => array('enabled' => 'published', 'locked_on' => 'checked_out_time', 'locked_by' => 'checked_out', 'slug' => 'alias'), 'filters' => array('description' => array('html', 'tidy'), 'url' => array('url'), 'params' => array('ini'))));
parent::_initialize($config);
}
示例4: _initialize
public function _initialize(KConfig $config)
{
$sluggable = $this->getBehavior('sluggable', array('columns' => array('name')));
$orderable = $this->getBehavior('com://admin/categories.database.behavior.orderable', array('parent_column' => 'catid'));
$config->append(array('identity_column' => 'bid', 'base' => 'banner', 'name' => 'banner', 'behaviors' => array('creatable', 'lockable', $sluggable, $orderable, 'hittable'), 'column_map' => array('enabled' => 'showBanner', 'created_on' => 'date', 'locked_on' => 'checked_out_time', 'locked_by' => 'checked_out', 'slug' => 'alias', 'hits' => 'clicks'), 'filters' => array('custombannercode' => array('html', 'tidy'), 'params' => 'ini')));
parent::_initialize($config);
}
示例5: _initialize
public function _initialize(KConfig $config)
{
$sluggable = $this->getBehavior('sluggable', array('columns' => array('name')));
$orderable = $this->getBehavior('com://admin/categories.database.behavior.orderable', array('parent_column' => 'catid'));
$config->append(array('identity_column' => 'id', 'base' => 'newsfeeds', 'name' => 'newsfeeds', 'behaviors' => array('lockable', $orderable, $sluggable), 'column_map' => array('enabled' => 'published', 'locked_on' => 'checked_out_time', 'locked_by' => 'checked_out', 'slug' => 'alias'), 'filters' => array('slug' => 'slug', 'link' => 'url')));
parent::_initialize($config);
}
示例6: _initialize
protected function _initialize(KConfig $config)
{
$config->identity_column = 'id';
$config->append(array(
'name' => 'menu',
'behaviors' => array('lockable', 'sluggable', 'nestable'),
'column_map' => array(
'title' => 'name',
'enabled' => 'published',
'locked_by' => 'checked_out',
'locked_on' => 'checked_out_time',
'slug' => 'alias',
'group_id' => 'access',
'level' => 'sublevel',
'component_id' => 'componentid',
'pages_menu_name' => 'menutype',
'parent_id' => 'parent'
),
'filters' => array(
'params' => 'ini'
)
));
parent::_initialize($config);
}
示例7: _initialize
public function _initialize(KConfig $config)
{
$config->identity_column = 'id';
$sluggable = $this->getBehavior('sluggable', array('columns' => array('name')));
$config->append(array('name' => 'contact_details', 'behaviors' => array('orderable', 'lockable', $sluggable), 'column_map' => array('enabled' => 'published', 'locked_on' => 'checked_out_time', 'locked_by' => 'checked_out', 'slug' => 'alias', 'category' => 'catid'), 'filters' => array('params' => 'ini')));
parent::_initialize($config);
}
示例8: _initialize
public function _initialize(KConfig $config)
{
$config->append(array(
'name' => 'modules_menu',
));
parent::_initialize($config);
}
示例9: _initialize
protected function _initialize(KConfig $config)
{
$config->append(array(
'name' => 'core_acl_aro'
));
parent::_initialize($config);
}
示例10: _deleteRevisions
/**
* Delete one or all revisions for a row
*
* @param string The row status to look for
* @return boolean
*/
protected function _deleteRevisions($status = null)
{
$query = array('table' => $this->getTable()->getName(), 'row' => $this->id);
if ($status) {
$query['status'] = $status;
}
return $this->_table->select($query)->delete();
}
示例11: getDefaults
/**
* Get default values for all columns
*
* This method is specialized in order to set the default module position
* and published state
*
* @return array
*/
public function getDefaults()
{
$defaults = parent::getDefaults();
$defaults['position'] = 'left';
$defaults['enabled'] = 1;
$defaults['description'] = '';
$defaults['module'] = 'mod_custom';
return $defaults;
}
示例12: _initialize
protected function _initialize(KConfig $config)
{
$config->append(array(
'name' => 'session',
'base' => 'session'
));
parent::_initialize($config);
}
示例13: insert
/**
* Insert a new row into the table
*
* Takes care of automatically incrementing the revision number
*
* @param KDatabaseRowInterface $row
*/
public function insert(KDatabaseRowInterface $row)
{
$query = $this->getDatabase()->getQuery()->where('table', '=', $row->table)->where('row', '=', $row->row)->order('revision', 'desc')->limit(1);
$latest = $this->select($query, KDatabase::FETCH_ROW);
if (!$latest->isNew()) {
$row->revision = $latest->revision + 1;
}
return parent::insert($row);
}
示例14: _initialize
public function _initialize(KConfig $config)
{
$config->identity_column = 'id';
$config->append(array(
'name' => 'components',
'filters' => array('params' => 'ini')
));
parent::_initialize($config);
}
示例15: insert
/**
* Table insert method
*
* @param object A KDatabaseRow object
* @return boolean TRUE if successfull, otherwise false
*/
public function insert(KDatabaseRowAbstract $row)
{
$query = $this->_database->getQuery();
$query->where('tbl.name', '=', $row->name, 'or');
if ($this->count($query)) {
$asset = $this->select($query, KDatabase::FETCH_ROW);
$data = array_merge($asset->getData(), array_filter($row->getData()));
return parent::update($asset->setData($data));
}
return parent::insert($row);
}