本文整理汇总了PHP中Includes\Utils\ArrayManager::getObjectsArrayFieldValues方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayManager::getObjectsArrayFieldValues方法的具体用法?PHP ArrayManager::getObjectsArrayFieldValues怎么用?PHP ArrayManager::getObjectsArrayFieldValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\ArrayManager
的用法示例。
在下文中一共展示了ArrayManager::getObjectsArrayFieldValues方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTranslationCodes
/**
* Get translation codes
*
* @return array
*/
public function getTranslationCodes()
{
return \Includes\Utils\ArrayManager::getObjectsArrayFieldValues($this->getTranslations()->toArray(), 'getCode');
}
示例2: checkAddonsKeys
/**
* The certain request handler
*
* @param integer $ttl Data TTL OPTIONAL
*
* @return boolean
*/
public function checkAddonsKeys($ttl = self::TTL_LONG)
{
$repoModuleKey = \XLite\Core\Database::getRepo('\\XLite\\Model\\ModuleKey');
$keys = array_unique(\Includes\Utils\ArrayManager::getObjectsArrayFieldValues($repoModuleKey->findAll(), 'getKeyValue', true));
$result = $this->performActionWithTTL($ttl, static::ACTION_CHECK_ADDON_KEY, array(static::FIELD_KEY => $keys), false);
if (static::TTL_NOT_EXPIRED !== $result) {
$repoModule = \XLite\Core\Database::getRepo('\\XLite\\Model\\Module');
foreach ((array) $result as $key => $addonsInfo) {
$repoModuleKey->deleteInBatch($repoModuleKey->findBy(array('keyValue' => $key)));
foreach ($addonsInfo as $info) {
$module = $repoModule->findOneBy(array('author' => $info['author'], 'name' => $info['name']));
if ($module) {
$repoModuleKey->insert($info + array('keyValue' => $key));
// Clear cache for proper installation
\XLite\Core\Marketplace::getInstance()->clearActionCache(\XLite\Core\Marketplace::ACTION_GET_ADDONS_LIST);
} else {
// No module has been found
}
}
}
}
return (bool) $result;
}
示例3: checkAddonsKeys
/**
* The certain request handler
*
* @param integer $ttl Data TTL OPTIONAL
*
* @return boolean
*/
public function checkAddonsKeys($ttl = null)
{
$repoModuleKey = \XLite\Core\Database::getRepo('\\XLite\\Model\\ModuleKey');
$keys = array_unique(\Includes\Utils\ArrayManager::getObjectsArrayFieldValues($repoModuleKey->findAll(), 'getKeyValue', true));
if (!empty($keys)) {
$result = $this->performActionWithTTL($ttl, static::ACTION_CHECK_ADDON_KEY, array(static::FIELD_KEY => $keys), false);
} else {
$result = null;
}
if (static::TTL_NOT_EXPIRED !== $result) {
$repoModule = \XLite\Core\Database::getRepo('\\XLite\\Model\\Module');
foreach ((array) $result as $key => $addonsInfo) {
foreach ($addonsInfo as $info) {
if ('CDev' == $info['author'] && 'Core' == $info['name']) {
// Entity is core
$isValid = true;
} else {
// Entity is module. Search for existing module
$isValid = (bool) $repoModule->findOneBy(array('author' => $info['author'], 'name' => $info['name']));
}
// Search for existing module key
$keyModel = $repoModuleKey->findOneBy(array('keyValue' => $key, 'author' => $info['author'], 'name' => $info['name']));
if ($isValid) {
if ($keyModel) {
$repoModuleKey->update($keyModel, $info);
} else {
$repoModuleKey->insert($info + array('keyValue' => $key));
}
// Clear cache for proper installation
$this->clearActionCache(\XLite\Core\Marketplace::ACTION_GET_ADDONS_LIST);
} else {
// No module has been found
if ($keyModel) {
$repoModuleKey->delete($keyModel);
}
}
}
}
}
return (bool) $result;
}
示例4: getErrorMessages
/**
* Return list of error messages
*
* @return array
*/
public function getErrorMessages()
{
if (!isset($this->errorMessages)) {
$this->errorMessages = array();
$freeSpaceError = $this->isFreeSpaceCheckAvailable() ? $this->checkDiskFreeSpace() : false;
if (!$this->isUnpacked() && $freeSpaceError) {
$this->errorMessages[self::CORE_IDENTIFIER] = array($freeSpaceError);
}
$this->errorMessages = array_merge($this->errorMessages, \Includes\Utils\ArrayManager::getObjectsArrayFieldValues($this->getEntries(), 'getErrorMessages'));
$this->errorMessages = array_filter($this->errorMessages);
}
return $this->errorMessages;
}
示例5: isUpgradeEntryAvailable
/**
* Check if upgrade or update is available on Marketplace.
*
* @return boolean
*/
public function isUpgradeEntryAvailable()
{
\XLite\Upgrade\Cell::getInstance()->clear();
return (bool) array_filter(\Includes\Utils\ArrayManager::getObjectsArrayFieldValues(\XLite\Upgrade\Cell::getInstance()->getEntries(), 'isEnabled'));
}