/** * Constructs a new Repository * * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager */ public function __construct(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) { $this->cicbaseConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['cicbase']); $overrides = Arr::safePath($GLOBALS, 'TYPO3_CONF_VARS.EXTCONF.cicbase.document.awsConfs'); if ($overrides) { $this->cicbaseConfiguration = ArrayUtility::arrayMergeRecursiveOverrule($this->cicbaseConfiguration, $overrides, FALSE, FALSE); } parent::__construct($objectManager); }
/** * @param string|array $uids * @param mixed $valueColumn See Arr::column * @param mixed $keyColumn See Arr::column * @return array|NULL * @throws \Exception */ public function findByUids($uids, $valueColumn = NULL, $keyColumn = NULL) { $select = '*'; $uids = Arr::commaListToArray($uids, "CategoryService expected uids to be a comma list or an array"); if (empty($uids)) { return array(); } $where = "uid IN (" . implode(',', $uids) . ') ' . BackendUtility::deleteClause(self::$categoryTable); $rows = $this->getDatabase()->exec_SELECTgetRows($select, self::$categoryTable, $where, '', 'sorting ASC'); if (!is_array($rows) || empty($rows)) { return array(); } if ($valueColumn || $keyColumn) { return Arr::column($rows, $valueColumn, $keyColumn); } return $rows; }
/** * @param string $field * @param string $parseFuncTSPath * @param bool $raw * @return string */ public function render($field, $parseFuncTSPath = 'lib.parseFunc_RTE', $raw = FALSE) { if (!$this->templateVariableContainer->exists('settings')) { return $this->renderChildren(); } $settings = $this->templateVariableContainer->get('settings'); if (isset($settings['pluginConfiguration']) && is_array($settings['pluginConfiguration'])) { $val = Arr::safePath($settings['pluginConfiguration'], $field); if ($val && $val !== '') { if ($raw) { return $val; } $this->simulateFrontendEnvironment(); $content = $this->contentObject->parseFunc($val, array(), '< ' . $parseFuncTSPath); $this->resetFrontendEnvironment(); return $content; } } return $this->renderChildren(); }
/** @test */ public function itDescribesDifferences() { $alpha = array(1, 2, 3, 4, 8); $beta = array(3, 4, 5, 6, 7); $diff = Arr::describeDifferences($alpha, $beta); $this->assertEquals($diff['both'], array(2 => 3, 3 => 4)); $this->assertEquals($diff['alpha'], array(1, 2, 4 => 8)); $this->assertEquals($diff['beta'], array(2 => 5, 3 => 6, 4 => 7)); }
/** * @param $ext * @return array */ protected function getTyposcriptForExtension($ext) { $allTyposcript = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT); if (!isset($allTyposcript['plugin.']["tx_{$ext}."])) { return FALSE; } $keyTrimmer = function ($key) { return rtrim($key, '.'); }; $extConf = $allTyposcript['plugin.']["tx_{$ext}."]; Arr::walkKeysRecursive($extConf, $keyTrimmer); return $extConf; }
public static function getLastQuery($table) { return Arr::safe(self::$lastSQL, $table); }
/** * Like rows() but works with an existing QueryResult. * * @param QueryResultInterface $result * @param null $keyField See \CIC\Cicbase\Arr::column * @param null $valueField See \CIC\Cicbase\Arr::column * @return array * @throws \Exception */ public function rowsFromQueryResult(QueryResultInterface $result, $keyField = NULL, $valueField = NULL) { $rows = $this->persistenceManager->getObjectDataByQuery($result->getQuery()); if ($keyField !== NULL || $valueField !== NULL) { return Arr::column($rows, $valueField, $keyField); } return $rows; }