本文整理汇总了PHP中KObjectConfig::set方法的典型用法代码示例。如果您正苦于以下问题:PHP KObjectConfig::set方法的具体用法?PHP KObjectConfig::set怎么用?PHP KObjectConfig::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KObjectConfig
的用法示例。
在下文中一共展示了KObjectConfig::set方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set
/**
* Set a configuration element
*
* @param string
* @param mixed
* @return void
*/
public function set($name, $value)
{
parent::set($name, $value);
//Only calculate the limit and offset if we have a total
if ($this->total) {
$this->limit = (int) max($this->limit, 1);
$this->offset = (int) max($this->offset, 0);
if ($this->limit > $this->total) {
$this->offset = 0;
}
if (!$this->limit) {
$this->offset = 0;
$this->limit = $this->total;
}
$this->count = (int) ceil($this->total / $this->limit);
if ($this->offset > $this->total) {
$this->offset = ($this->count - 1) * $this->limit;
}
$this->current = (int) floor($this->offset / $this->limit) + 1;
}
}
示例2: setIdentityKey
/**
* Set the identity key
*
* @param mixed $value
* @return KModelContext
*/
public function setIdentityKey($value)
{
return KObjectConfig::set('identity_key', $value);
}
示例3: setData
/**
* Set the view data
*
* @param array $data
* @return KViewContext
*/
public function setData($data)
{
return KObjectConfig::set('data', $data);
}
示例4: setAction
/**
* Set the controller action
*
* @param string $action
* @return KControllerContext
*/
public function setAction($action)
{
return KObjectConfig::set('action', $action);
}
示例5: setState
/**
* Sets the time limit
*
* @param KObjectConfig|array $state
* @return $this
*/
public function setState($state)
{
return KObjectConfig::set('state', $state);
}
示例6: setLayout
/**
* Set the view layout
*
* @param string $layout
* @return KViewContextTemplate
*/
public function setLayout($layout)
{
return KObjectConfig::set('layout', $layout);
}
示例7: set
/**
* Set a command property or attribute
*
* If an event property exists the property will be set, otherwise an attribute will be added.
*
* @param string $name
* @param mixed $value
* @return KCommand
*/
public final function set($name, $value)
{
$method = 'set' . ucfirst($name);
if (!method_exists($this, $method)) {
parent::set($name, $value);
} else {
$this->{$method}($value);
}
return $this;
}
示例8: setException
/**
* Set the exception
*
* @param Exception $exception
*/
public function setException(Exception $exception)
{
return KObjectConfig::set('exception', $exception);
}
示例9: setAffected
/**
* Get the number of affected rows
*
* @param integer $affected
* @return KDatabaseContext
*/
public function setAffected($affected)
{
return KObjectConfig::set('affected', $affected);
}
示例10: set
/**
* Set a configuration item
*
* @param string $name
* @param mixed $value
* @return void
*/
public function set($name, $value)
{
if (is_array($value)) {
$value = new KObjectConfig($value);
}
parent::set($name, $value);
}