/** * @param array $keys * @return array */ protected function collectColumnsForKeys(array $keys) { $columns = $this->defaultColumns(); foreach ($keys as $key) { $KeyObject = Keys::get($key); if ($KeyObject->isInDatabase()) { if ($KeyObject->requiresJoin()) { $joinDefinition = $KeyObject->joinDefinition(); if (!array_key_exists($joinDefinition['column'], $this->JoinTables)) { $this->JoinTables[$joinDefinition['column']] = $joinDefinition; } } else { $appendix = $KeyObject->column(); if (is_array($appendix)) { $columns = array_merge($columns, $appendix); } else { $columns[] = $appendix; } } } } return array_unique($columns); }
/** * Generate data array from base class * @param array $keysArray array(keyid => active(true|false)) */ protected function generateDataFor(array $keysArray) { foreach ($keysArray as $keyid => $isActive) { $this->Data[$keyid] = array('active' => $isActive, 'style' => Keys::get($keyid)->defaultCssStyle()); } }