本文整理汇总了PHP中Includes\Utils\ArrayManager::getIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayManager::getIndex方法的具体用法?PHP ArrayManager::getIndex怎么用?PHP ArrayManager::getIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\ArrayManager
的用法示例。
在下文中一共展示了ArrayManager::getIndex方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCriticalPath
/**
* Method to get critical path length for a node
*
* @param string $module Module actual name
*
* @return integer
*/
public function getCriticalPath($module)
{
if (!isset($this->criticalPaths)) {
$this->criticalPaths = $this->calculateCriticalPathLengths();
}
return \Includes\Utils\ArrayManager::getIndex($this->criticalPaths, $module);
}
示例2: translate
/**
* Translate label
*
* @param string $name Label name
* @param string $code Language code
*
* @return string|void
*/
public function translate($name, $code)
{
if (!isset($this->translations[$code])) {
$this->translations[$code] = $this->getRepo()->findLabelsByCode($code);
}
return \Includes\Utils\ArrayManager::getIndex($this->translations[$code], $name);
}
示例3: getAllMetadata
/**
* Return all classes metadata
*
* @param string $class Class name OPTIONAL
*
* @return array
*/
public static function getAllMetadata($class = null)
{
if (!isset(static::$metadata)) {
static::$metadata = array();
// Create hash array to quick access its elements
foreach (static::getHandler()->getMetadataFactory()->getAllMetadata() as $data) {
static::$metadata[$data->name] = $data;
}
}
return \Includes\Utils\ArrayManager::getIndex(static::$metadata, $class);
}
示例4: getDependencyCSSClass
/**
* Get some data for depenendecy in list
*
* @param \XLite\Model\Module $module Current module
*
* @return string
*/
protected function getDependencyCSSClass(\XLite\Model\Module $module)
{
return \Includes\Utils\ArrayManager::getIndex($this->getDependencyData($module), 'class', true);
}
示例5: addTags
/**
* Parse template and add tags to the list
*
* @param array $data Tags data
* @param string $path Template file path
*
* @return array
*/
protected function addTags(array $data, $path)
{
$base = \Includes\Utils\FileManager::getRelativePath($path, LC_DIR_SKINS);
foreach ($data as $tags) {
$skin = \Includes\Utils\ArrayManager::getIndex(explode(LC_DS, $base), 0, true);
$zone = array_search($skin, static::$zones) ?: \XLite\Model\ViewList::INTERFACE_CUSTOMER;
$template = substr($base, strpos($base, LC_DS) + ('common' == $skin ? 1 : 4));
static::$annotatedTemplates[] = array('tpl' => $template, 'zone' => $zone, 'path' => $path) + $tags;
}
}
示例6: getRowTitle
/**
* Get row heading
*
* @param string $row Row identificator
*
* @return array|string
*/
public function getRowTitle($row)
{
return \Includes\Utils\ArrayManager::getIndex($this->getRowTitles(), $row);
}
示例7: getField
/**
* Alias
*
* @param array $data Data to get field value from
* @param string $field Name of field to get
*
* @return mixed
*/
protected function getField(array $data, $field)
{
return \Includes\Utils\ArrayManager::getIndex($data, $field, true);
}
示例8: prepareBuyerData
/**
* Translate array of data received from Paypal to the array for updating cart
*
* @param array $paypalData Array of customer data received from Paypal
*
* @return array
*/
public function prepareBuyerData($paypalData)
{
$countryCode = \Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTOCOUNTRYCODE');
$country = \XLite\Core\Database::getRepo('XLite\\Model\\Country')->findOneByCode($countryCode);
$stateCode = \Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTOSTATE');
$state = $country && $stateCode ? \XLite\Core\Database::getRepo('XLite\\Model\\State')->findOneByCountryAndCode($country->getCode(), $stateCode) : null;
$street = trim(\Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTOSTREET') . ' ' . \Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTOSTREET2'));
$data = array('shippingAddress' => array('name' => (string) \Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTONAME'), 'street' => $street, 'country' => $country ?: '', 'state' => $state ? $state : (string) \Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTOSTATE'), 'city' => (string) \Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTOCITY'), 'zipcode' => (string) \Includes\Utils\ArrayManager::getIndex($paypalData, 'SHIPTOZIP'), 'phone' => (string) \Includes\Utils\ArrayManager::getIndex($paypalData, 'PHONENUM')));
return $data;
}
示例9: isRedirectToCleanURLNeeded
/**
* Check if redirect to clean URL is needed
*
* @return boolean
*/
protected function isRedirectToCleanURLNeeded()
{
return preg_match('/\\/cart\\.php/Si', \Includes\Utils\ArrayManager::getIndex(\XLite\Core\Request::getInstance()->getServerData(), 'REQUEST_URI'));
}
示例10: getListDisplayCode
/**
* Return code for the parsed "<list ... />" tag
*
* @param array $attrs All tag attributes
*
* @return string
*/
protected function getListDisplayCode(array $attrs)
{
$type = ucfirst(\Includes\Utils\ArrayManager::getIndex($attrs, 'type'));
$name = \Includes\Utils\ArrayManager::getIndex($attrs, 'name');
$this->unsetAttributes($attrs, array('type', 'name'));
$args = '';
if (!empty($attrs)) {
$args .= ', ' . $this->getAttributesList($attrs);
}
return '$this->display' . $type . 'ViewListContent(' . $this->flexyAttribute($name) . $args . ');';
}
示例11: isActiveModule
/**
* Check if module is active
*
* @param string|null $moduleName Module name
*
* @return boolean
*/
public static function isActiveModule($moduleName)
{
return (bool) \Includes\Utils\ArrayManager::getIndex(static::getActiveModules(), $moduleName, true);
}
示例12: getTag
/**
* Get tag info
*
* @param string $name Tag name
* @param boolean $forceTokenizer Flag to force tokenizer use (since LC_Dependencies classes could be non-working)
*
* @return array
*/
public function getTag($name, $forceTokenizer = false)
{
return \Includes\Utils\ArrayManager::getIndex($this->getTags($forceTokenizer), strtolower($name), true);
}
示例13: addTags
/**
* Parse template and add tags to the list
*
* @param array $data Tags data
* @param string $path Template file path
*
* @return array
*/
protected function addTags(array $data, $path)
{
$base = \Includes\Utils\FileManager::getRelativePath($path, LC_DIR_SKINS);
$skin = \Includes\Utils\ArrayManager::getIndex(explode(LC_DS, $base), 0, true);
static::$annotatedTemplates[] = array('tpl' => $base, 'zone' => array_search($skin, static::$zones) ?: \XLite\Model\ViewList::INTERFACE_CUSTOMER, 'path' => $path, 'tags' => $data);
}
示例14: getFixturesLoadingOption
/**
* Get fixtures loading procedure option
*
* @param string $name Option name
*
* @return mixed
*/
public function getFixturesLoadingOption($name)
{
return \Includes\Utils\ArrayManager::getIndex($this->fixturesLoadingOptions, $name, true);
}
示例15: getExtension
/**
* Return extension for the archive file
*
* @return string
*/
public static function getExtension()
{
return \Includes\Utils\ArrayManager::getIndex(static::$extensions, self::COMPRESSION_TYPE, true);
}