本文整理汇总了PHP中KObject::_initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP KObject::_initialize方法的具体用法?PHP KObject::_initialize怎么用?PHP KObject::_initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KObject
的用法示例。
在下文中一共展示了KObject::_initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
protected function _initialize(KConfig $config)
{
if (empty($config->adapters)) {
$config->adapters = array('image', 'finfo');
}
parent::_initialize($config);
}
示例2: _initialize
protected function _initialize(KObjectConfig $config)
{
$config->append(array(
'path' => ''
));
parent::_initialize($config);
}
示例3: _initialize
/**
* Initializes the options for the object
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param object An optional KConfig object with configuration options
* @return void
*/
protected function _initialize(KConfig $config)
{
$config->append(array(
'state' => KFactory::get('koowa:config.state'),
));
parent::_initialize($config);
}
示例4: _initialize
/**
* Initializes the options for the object
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param object An optional KConfig object with configuration options
* @return void
*/
protected function _initialize(KConfig $config)
{
$config->append(array(
'priority' => KCommand::PRIORITY_NORMAL,
));
parent::_initialize($config);
}
示例5: _initialize
/**
* Initializes the options for the object
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param object An optional KConfig object with configuration options
* @return void
*/
protected function _initialize(KConfig $config)
{
$config->append(array(
'data' => array(),
));
parent::_initialize($config);
}
示例6: _initialize
protected function _initialize($config)
{
try {
$config->append(array('manifest' => null, 'translator' => $this->getService('translator')));
} catch (KServiceIdentifierException $e) {
throw new KException('Please first upgrade EXTman to be able to use this extension.');
}
parent::_initialize($config);
}
示例7: _initialize
protected function _initialize(KConfig $config)
{
// TODO: Set the database to be a singleton, use com:application.database
$database = $this->getService('com://site/mongo.database.adapter.document');
$package = $this->getIdentifier()->package;
$name = $this->getIdentifier()->name;
$config->append(array('command_chain' => $this->getService('koowa:command.chain'), 'event_dispatcher' => $this->getService('koowa:event.dispatcher'), 'dispatch_events' => false, 'enable_callbacks' => false, 'database' => $database, 'behaviors' => array(), 'filters' => array(), 'name' => empty($package) ? $name : $package . '_' . $name));
parent::_initialize($config);
}
示例8: _initialize
protected function _initialize(KConfig $config)
{
if (empty($config->adapters)) {
$config->adapters = array('finfo');
} elseif (is_string($config->adapters)) {
$config->adapters = array($config->adapters);
}
parent::_initialize($config);
}
示例9: _initialize
/**
* Initializes the options for the object
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param array Options
* @return array Options
*/
protected function _initialize(KConfig $options)
{
$name = isset($options->name) ? $options->name : (string) $this->node['name'];
$id = isset($options->id) ? $options->id : isset($this->node['id']) ? (string) $this->node['id'] : $name;
$label = isset($this->node['label']) ? (string) $this->node['label'] : false;
$label = $label ? $label : KInflector::humanize((string) $this->node['name']);
$options->append(array('parent' => false, 'identifier' => null, 'group' => false, 'fetchTooltip' => true, 'name' => $name, 'id' => $id, 'label' => $label));
parent::_initialize($options);
}
示例10: _initialize
/**
* Initializes the options for the object
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param object An optional KConfig object with configuration options.
* @return void
*/
protected function _initialize(KConfig $config)
{
$config->append(array(
'dispatcher' => KFactory::get('koowa:event.dispatcher'),
'auto_connect' => true,
'priority' => KCommand::PRIORITY_NORMAL
));
parent::_initialize($config);
}
示例11: _initialize
protected function _initialize(KConfig $config)
{
$config->append(array(
'storage_path' => 'docs',
'storage_name' => null,
'storage' => null,
'selector' => 'default',
'type' => $this->_identifier->name
));
parent::_initialize($config);
}
示例12: _initialize
/**
* Initializes the default configuration for the object.
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param KConfig $config An optional KConfig object with configuration options.
*/
protected function _initialize(KConfig $config)
{
$description = $this->_description;
$properties = $description->getProperty();
$validations = array();
foreach ($properties as $property) {
if ($property->isAttribute() && $property->getFormat()) {
$validations[$property->getName()]['format'] = $property->getFormat();
}
if ($property->isSerializable() && $property->isRequired()) {
$validations[$property->getName()]['required'] = true;
}
if ($property->isSerializable() && $property->isUnique()) {
$validations[$property->getName()]['uniqueness'] = array('scope' => array());
}
}
$config->append(array('validations' => $validations));
parent::_initialize($config);
}
示例13: _initialize
/**
* Initializes the options for the object
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param KObjectConfig $config An optional ObjectConfig object with configuration options.
* @return void
*/
protected function _initialize(KObjectConfig $config)
{
$config->append(array('locale' => 'en-GB'));
parent::_initialize($config);
}
示例14: _initialize
/**
* Initializes the default configuration for the object.
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param KConfig $config An optional KConfig object with configuration options.
*/
protected function _initialize(KConfig $config)
{
$config->append(array('response' => null));
parent::_initialize($config);
}
示例15: _initialize
/**
* Initializes the default configuration for the object
*
* Called from {@link __construct()} as a first step of object instantiation.
*
* @param KConfig $config An optional KConfig object with configuration options.
*
* @return void
*/
protected function _initialize(KConfig $config)
{
$config->append(array('folder' => 'assets'));
parent::_initialize($config);
}