本文整理汇总了PHP中XLite\Core\Converter::convertFromCamelCase方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::convertFromCamelCase方法的具体用法?PHP Converter::convertFromCamelCase怎么用?PHP Converter::convertFromCamelCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Core\Converter
的用法示例。
在下文中一共展示了Converter::convertFromCamelCase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isPropertyExists
/**
* Return true if specified property exists
*
* @param string $name Property name
*
* @return boolean
*/
public function isPropertyExists($name)
{
return property_exists($this, $name) || property_exists($this, \XLite\Core\Converter::convertFromCamelCase($name));
}
示例2: buildEditURL
/**
* Build edit url
*
* @param \XLite\Model\AEntity $entity Entity
*
* @return string
*/
public function buildEditURL($entity)
{
$result = '';
$entityType = static::getEntityType($entity);
$method = $entityType ? __FUNCTION__ . \XLite\Core\Converter::convertToCamelCase($entityType) : null;
$data = method_exists($this, $method) ? $this->{$method}($entity) : array(\XLite\Core\Converter::convertFromCamelCase($entityType), array($entity->getUniqueIdentifierName() => $entity->getUniqueIdentifier()));
if ($data) {
list($target, $params) = $data;
if ($target) {
$result = \XLite\Core\Converter::buildURL($target, '', $params);
}
}
return $result;
}
示例3: __call
/**
* Emulate the Doctrine autogenerated methods.
* TODO - DEVCODE - to remove!
*
* @param string $method Method name
* @param array $args Call arguments OPTIONAL
*
* @return mixed
* @throws \BadMethodCallException
*/
public function __call($method, array $args = array())
{
$result = preg_match('/^(get|set)(\\w+)$/Si', $method, $matches) && !empty($matches[2]);
if ($result) {
$property = \XLite\Core\Converter::convertFromCamelCase($matches[2]);
$result = property_exists($this, $property);
}
$return = null;
if ($result) {
if ('set' === $matches[1]) {
$this->{$property} = array_shift($args);
} else {
$return = $this->{$property};
}
} else {
throw new \BadMethodCallException(get_class($this) . '::' . $method . '() - method not exists or invalid getter/setter');
}
return $return;
}
示例4: __call
/**
* Emulate the Doctrine autogenerated methods.
* TODO - DEVCODE - to remove!
*
* @param string $method Method name
* @param array $args Call arguments OPTIONAL
*
* @return mixed
*/
public function __call($method, array $args = array())
{
$result = preg_match('/^(get|set)(\\w+)$/Si', $method, $matches) && !empty($matches[2]);
if ($result) {
$property = \XLite\Core\Converter::convertFromCamelCase($matches[2]);
$result = 'set' === $matches[1] ? $this->setterProperty($property, array_shift($args)) : $this->getterProperty($property);
} else {
$result = null;
}
return $result;
}