本文整理汇总了PHP中ObjectConfig::set方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectConfig::set方法的具体用法?PHP ObjectConfig::set怎么用?PHP ObjectConfig::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectConfig
的用法示例。
在下文中一共展示了ObjectConfig::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: setAffected
/**
* Get the number of affected rows
*
* @param integer $affected
* @return DatabaseContext
*/
public function setAffected($affected)
{
return ObjectConfig::set('affected', $affected);
}
示例3: setIdentityKey
/**
* Set the identity key
*
* @param mixed $value
* @return ModelContext
*/
public function setIdentityKey($value)
{
return ObjectConfig::set('identity_key', $value);
}
示例4: set
/**
* Set a command property or attribute
*
* If an command property exists the property will be set, otherwise an attribute will be added.
*
* @param string $name
* @param mixed $value
* @return Command
*/
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;
}
示例5: set
/**
* Set a configuration item
*
* @param string $name
* @param mixed $value
* @return void
*/
public function set($name, $value)
{
if (is_array($value)) {
$value = new ObjectConfig($value);
}
parent::set($name, $value);
}
示例6: setParameters
/**
* Set the view parameters
*
* @param array $parameters
* @return ViewContext
*/
public function setParameters($parameters)
{
return ObjectConfig::set('parameters', $parameters);
}
示例7: setEntity
/**
* Set the model entity
*
* @param ModelEntityInterface $entity
* @return ControllerContextModel
*/
public function setEntity($entity)
{
return ObjectConfig::set('entity', $entity);
}
示例8: setLayout
/**
* Set the view layout
*
* @param string $layout
* @return ViewContextTemplate
*/
public function setLayout($layout)
{
return ObjectConfig::set('layout', $layout);
}
示例9: setQuery
/**
* Set the model query
*
* @param DatabaseQueryInterface $query
* @return ModelContext
*/
public function setQuery($query)
{
return ObjectConfig::set('query', $query);
}
示例10: setUser
/**
* Set the user object
*
* @param UserInterface $user
* @return $this
*/
public function setUser(UserInterface $user)
{
return ObjectConfig::set('user', $user);
}