本文整理汇总了PHP中Includes\Utils\ArrayManager::searchInArraysArray方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayManager::searchInArraysArray方法的具体用法?PHP ArrayManager::searchInArraysArray怎么用?PHP ArrayManager::searchInArraysArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\ArrayManager
的用法示例。
在下文中一共展示了ArrayManager::searchInArraysArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCategoryName
/**
* Return translated category name
*
* :KLUDGE: it's the hack to prevent execution of superflous queries
*
* @param array $category Category data
*
* @return string
*/
protected function getCategoryName(array $category)
{
$name = null;
$query = \XLite\Core\Translation::getLanguageQuery(\XLite\Core\Session::getInstance()->getLanguage()->getCode());
foreach ($query as $code) {
$data = \Includes\Utils\ArrayManager::searchInArraysArray($category['translations'], 'code', $code);
if (!empty($data)) {
$name = $data['name'];
break;
}
}
return $name;
}
示例2: getAttributeValue
/**
* Get attribute column data
*
* @param \XLite\Model\Product $product Product object
* @param \XLite\Model\Attribute $attribute Attribute object
*
* @return array
*/
protected function getAttributeValue($product, $attributeName)
{
$value = null;
$attr = \Includes\Utils\ArrayManager::searchInArraysArray($this->getAttributesColumns(), 'attributeName', $attributeName);
if ($attr) {
$entity = \XLite\Core\Database::getRepo('XLite\\Model\\Attribute')->find($attr['attributeId']);
if ($entity) {
$value = $entity->getAttributeValue($product, true);
}
if ($value && is_array($value)) {
$value = array_shift($value);
}
}
return $value ?: '';
}
示例3: getCategoryName
/**
* Return translated category name
*
* :KLUDGE: it's the hack to prevent execution of superflous queries
*
* @param array $category Category data
*
* @return string
*/
protected function getCategoryName(array $category)
{
$data = \Includes\Utils\ArrayManager::searchInArraysArray($category['translations'], 'code', \XLite\Core\Session::getInstance()->getLanguage()->getCode());
return empty($data) ? null : $data['name'];
}