本文整理汇总了PHP中Nette\ObjectMixin类的典型用法代码示例。如果您正苦于以下问题:PHP ObjectMixin类的具体用法?PHP ObjectMixin怎么用?PHP ObjectMixin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ObjectMixin类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __call
/**
* Call to undefined method.
* @param string method name
* @param array arguments
* @return mixed
* @throws MemberAccessException
*/
public function __call($name, $args)
{
$class = new Nette\Reflection\ClassType($this);
if ($name === '') {
throw new Nette\MemberAccessException("Call to class '{$class->name}' method without name.");
}
// event functionality
if ($class->hasProperty($name)) {
if (!$this->_eventSetupCalled) {
$this->_eventSetupCalled = true;
$this->eventSetup();
$this->onEventSetup($this);
}
if (is_array($list = $this->{$name}) || $list instanceof \Traversable) {
foreach ($list as $handler) {
callback($handler)->invokeArgs($args);
}
}
return NULL;
}
// extension methods
if ($cb = Nette\ObjectMixin::getExtensionMethod(get_class($this), $name)) {
array_unshift($args, $this);
return $cb->invokeArgs($args);
}
throw new Nette\MemberAccessException("Call to undefined method {$class->name}::{$name}().");
}
开发者ID:vbuilder,项目名称:framework,代码行数:34,代码来源:Object.php
示例2: __unset
public function __unset($key)
{
$column = $this->formatColumnName($key);
if (parent::__isset($column) || !ObjectMixin::has($this, $key)) {
parent::__unset($column);
} else {
ObjectMixin::remove($this, $key);
}
}
开发者ID:fabik,项目名称:database,代码行数:9,代码来源:ActiveRow.php
示例3: getItemValue
/**
* @param $item
* @param $valueName
* @return mixed
*/
public function getItemValue($item, $valueName)
{
if (isset($this->columnAliases[$valueName])) {
$getterPath = $this->columnAliases[$valueName]->getterPath;
} else {
$getterPath = $valueName;
}
$getters = explode('.', $getterPath);
$value = $item;
foreach ($getters as $getter) {
$value = ObjectMixin::get($value, $getter);
}
return $value;
}
开发者ID:natrim,项目名称:gridito,代码行数:19,代码来源:DoctrineQueryBuilderModel.php
示例4: __call
public function __call($name, $args)
{
return Nette\ObjectMixin::callProperty($this, $name, $args);
}
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:4,代码来源:ClassType.php
示例5: __unset
/**
* Access to undeclared property.
* @param string property name
* @return void
* @throws Nette\MemberAccessException
*/
public function __unset($name)
{
Nette\ObjectMixin::remove($this, $name);
}
开发者ID:genextwebs,项目名称:dropbox-sample,代码行数:10,代码来源:CachingIterator.php
示例6: __isset
public function __isset($name)
{
return ObjectMixin::has($this, $name);
}
开发者ID:JPalounek,项目名称:IconStore,代码行数:4,代码来源:ParameterReflection.php
示例7: __call
/**
* @param $method
* @param $args
*/
public function __call($method, $args)
{
ObjectMixin::call($this, $method, $args);
}
开发者ID:peterzadori,项目名称:movi,代码行数:8,代码来源:Repository.php
示例8: __call
Nette\Object{public$name;public$value;public$static;public$visibility='public';public$documents=array();function
__call($name,$args){return
Nette\ObjectMixin::callProperty($this,$name,$args);}}}namespace Nette\Utils{use
开发者ID:JanTvrdik,项目名称:NetteExtras,代码行数:3,代码来源:loader.php
示例9: __isset
/**
* Is property defined?
*
* @param string property name
* @return bool
*/
public function __isset($name)
{
return ObjectMixin::has($this, $name) ? TRUE : (isset($this->_data[$name]) ? TRUE : array_key_exists($name, $this->_associations));
}
开发者ID:matak,项目名称:dbrecord,代码行数:10,代码来源:Entity.php
示例10: __set
public function __set($name, $value)
{
foreach ($this->getExtensions() as $extension) {
/* @var $extension ExtensionObject */
if ($extension->getReflection()->hasProperty($name)) {
$property = $extension->getReflection()->getProperty($name);
if ($property->isPublic() && !$property->isStatic()) {
$extension->{$name} = $value;
return;
}
}
if (ObjectMixin::has($extension, $name)) {
ObjectMixin::set($extension, $name, $value);
return;
}
}
return parent::__set($name, $value);
}
开发者ID:jsmitka,项目名称:ExtensionObjects,代码行数:18,代码来源:ExtensibleObject.php
注:本文中的Nette\ObjectMixin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论