本文整理汇总了PHP中KObjectConfig::unbox方法的典型用法代码示例。如果您正苦于以下问题:PHP KObjectConfig::unbox方法的具体用法?PHP KObjectConfig::unbox怎么用?PHP KObjectConfig::unbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KObjectConfig
的用法示例。
在下文中一共展示了KObjectConfig::unbox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterReset
/**
* Reset the cached container object if container changes
*
* @param KModelContextInterface $context
*/
protected function _afterReset(KModelContextInterface $context)
{
$modified = (array) KObjectConfig::unbox($context->modified);
if (in_array('container', $modified)) {
unset($this->_container);
}
}
示例2: __construct
/**
* Constructor
*
* @param KObjectConfig $config An optional ObjectConfig object with configuration options
*/
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
//Session write and close handlers are called after destructing objects since PHP 5.0.5.
if (version_compare(phpversion(), '5.4.0', '>=')) {
session_register_shutdown();
} else {
register_shutdown_function('session_write_close');
}
//Only configure the session if it's not active yet
if (!$this->isActive()) {
//Set the session options
$this->setOptions($config->options);
//Set the session name
if (!empty($config->name)) {
$this->setName($config->name);
}
//Set the session identifier
if (!empty($config->id)) {
$this->setId($config->id);
}
//Set the session handler
$this->setHandler($config->handler, KObjectConfig::unbox($config));
}
//Set the session namespace
$this->setNamespace($config->namespace);
//Set lifetime time
$this->getContainer('metadata')->setLifetime($config->lifetime);
}
示例3: __construct
/**
* Constructor.
*
* @param KObjectConfig $config Configuration options.
*/
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
$this->_title_column = KObjectConfig::unbox($config->title_column);
$this->_controller = $config->controller;
$this->setActions(KObjectConfig::unbox($config->actions));
}
示例4: __construct
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
$this->setThumbnailSize(KObjectConfig::unbox($config->thumbnail_size));
$this->_container = $config->container;
$this->_folder = $config->folder;
}
示例5: _afterReset
/**
* Reset the cached container object if container changes
*
* @param KModelContextInterface $context
*/
protected function _afterReset(KModelContextInterface $context)
{
$modified = (array) KObjectConfig::unbox($context->modified);
if (in_array('container', $modified)) {
self::$_container = null;
}
}
示例6: _saveGroups
protected function _saveGroups(KDatabaseRowInterface $entity)
{
$table = $this->getObject('com://admin/docman.database.table.levels');
$row = $table->select(array('entity' => $entity->uuid), KDatabase::FETCH_ROW);
$groups = KObjectConfig::unbox($entity->groups);
$access = null;
if (is_array($groups) && count($groups)) {
sort($groups);
$row->groups = implode(',', array_map('intval', $groups));
$row->entity = $entity->uuid;
if ($row->save()) {
$access = -1 * $row->id;
}
} elseif ($entity->inherit || $groups) {
if (!$row->isNew()) {
$row->delete();
}
$access = $groups ?: self::INHERIT;
}
if ($access !== null) {
if ($entity->getIdentifier()->name === 'document') {
$entity->access = $access;
} else {
$entity->access_raw = $access;
}
}
}
示例7: __construct
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
$this->_redirect_schemes = KObjectConfig::unbox($config->redirect_schemes);
$this->_redirect_unknown = $config->redirect_unknown;
}
示例8: __construct
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
if (isset($config->adapters)) {
$this->_adapters = KObjectConfig::unbox($config->adapters);
}
}
示例9: __construct
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
if ($config->fields) {
$this->_fields = KObjectConfig::unbox($config->fields);
}
}
示例10: __construct
/**
* Object constructor
*
* @param KObjectConfig $config Configuration options
* @throws InvalidArgumentException
*/
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
if (is_null($config->command_chain)) {
throw new InvalidArgumentException('command_chain [KCommandChainInterface] config option is required');
}
//Create a command chain object
$this->__command_chain = $config->command_chain;
//Add the event subscribers
$handlers = (array) KObjectConfig::unbox($config->command_handlers);
foreach ($handlers as $key => $value) {
if (is_numeric($key)) {
$this->addCommandHandler($value);
} else {
$this->addCommandHandler($key, $value);
}
}
//Add the command callbacks
foreach ($this->getMixer()->getMethods() as $method) {
$match = array();
if (preg_match('/_(after|before)([A-Z]\\S*)/', $method, $match)) {
$this->addCommandCallback($match[1] . '.' . strtolower($match[2]), $method);
}
}
}
示例11: __construct
/**
* Constructor.
*
* @param KObjectConfig $config An optional ObjectConfig object with configuration options.
*/
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
//Set the supported methods
$this->_methods = KObjectConfig::unbox($config->methods);
//Load the dispatcher translations
$this->addCommandCallback('before.dispatch', '_loadTranslations');
}
示例12: __construct
/**
* Constructor
*
* @param KObjectConfig $config An optional KObjectConfig object with configuration options
*/
public function __construct(KObjectConfig $config)
{
parent::__construct($config);
$headers = KObjectConfig::unbox($config->headers);
foreach ($headers as $key => $values) {
$this->set($key, $values);
}
}
示例13: _initialize
protected function _initialize(KObjectConfig $config)
{
$size = KObjectConfig::unbox($config->size);
if (empty($size)) {
$config->size = array('x' => 200, 'y' => 150);
}
parent::_initialize($config);
}
示例14: __construct
/**
* Constructor.
*
* @param KObjectConfig $config Configuration options
*/
public function __construct(KObjectConfig $config = null)
{
parent::__construct($config);
$this->_title = $config->title;
$this->_class = $config->class;
$this->_styles = KObjectConfig::unbox($config->styles);
$this->_attribs = KObjectConfig::unbox($config->attribs);
}
示例15: startPanel
/**
* Creates a tab panel with title and starts that panel
*
* @param array|KObjectConfig $config An optional array with configuration options
* @return string Html
*/
public function startPanel($config = array())
{
$translator = $this->getObject('translator');
$config = new KObjectConfigJson($config);
$config->append(array('title' => $translator->translate('Slide'), 'id' => '', 'translate' => true));
$title = $config->translate ? $translator->translate($config->title) : $config->title;
return JHtml::_('sliders.panel', $title, KObjectConfig::unbox($config->attribs));
}