getSlots()

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-12-22

@return array
496457
public static function getSlots()
    {
        $slots = array();

        foreach (array_keys(WindowMaker::getStartTimeChoices()) as $hour)
        {
            for ($i=0; $i<14; $i++)
            {
                $date = new \DateTime('+'.$i.' days');

                $slots[$hour.':00'][$date->format('Y-m-d')] = null;
            }
        }

        return $slots;
    }
903023
public function leagues(): array
    {
        $curlClient = curl_init(self::BASE_URL . self::LEAGUES_URL);
        curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
        curl_setopt($curlClient, CURLOPT_RETURNTRANSFER, true);
        $results = json_decode(curl_exec($curlClient), true);
        $leagues = [];
        foreach ($results['items'] as $result) {
            $leagues[] = League::create($result);
        }
        return $leagues;
    }
355859
public function getOtherGuidRules()
    {
        $rules = array_merge($this->getMutualRules(), [
            [[$this->otherGuidAttribute,
                $this->createdByAttribute],
                'unique',
                'targetAttribute' => [$this->otherGuidAttribute, $this->createdByAttribute]],
        ]);
        return $rules;
    }
156403
private function getScriptsContainers()
    {
        $container = null;
        $config    = null;
        foreach (['container', 'app', 'foundation'] as $name) {
            if (isset($this->{$name}) && is_null($container)) {
                $container = $this->{$name}->make('antares.asset');
                $config    = $this->{$name}->make('config');
                break;
            }
        }
        if (is_null($container)) {
            $container = app('antares.asset');
        }
        if (is_null($config)) {
            $config = app('config');
        }
        return [
            'container' => $container,
            'config'    => $config
        ];
    }
1128208
public function getTables()
    {
        $tables = [];
        if ($this->serverSupportFeature(3)) {
            $result = $this->runMongoCommand(['listCollections' => 1]);
            foreach ($result as $val) {
                $tables[] = $val['name'];
            }
        } else {
            $result = $this->runMongoQuery('system.namespaces');
            foreach ($result as $val) {
                if (strpos($val['name'], '$') === false) {
                    $tables[] = substr($val['name'], strpos($val['name'], '.') + 1);
                }
            }
        }

        return $tables;
    }
226140
public function getSorts()
    {
        $ret = [];

        foreach ($this->fields as $alias => $description) {
            $ret[$alias] = $description['label'];
        }

        return $ret;
    }
269327
public function getAll()
    {
        $result = array();

        foreach (Data::$currencies as $currency) {
            $result[] = $this->getObjectFromArray($currency);
        }

        return $result;
    }
345592
public function getSchedule()
    {
        $list = [];

        foreach ($this->schedule as $time => $jobs) {
            foreach ($jobs as $job) {
                $list[$time][] = $job->getId();
            }
        }

        return $list;
    }
951648
private function getIptables()
    {
        $result = array();
        $i = 0;

        foreach ($this->_lines as $line) {
            $result[$i]['rule'] = $line;
            $i++;
        }

        return $result;
    }
750562
public function getSlotContents()
    {
        if ($this->slots === null) {
            $fileService = new File();
            $appVersion = Config::get('concrete.version');
            $cfToken = Marketplace::getSiteToken();
            $url = Config::get('concrete.urls.newsflow') . Config::get('concrete.urls.paths.newsflow_slot_content');
            $path = $url . '?cfToken=' . rawurlencode($cfToken) . '&appVersion=' . $appVersion;
            $response = $fileService->getContents($path);
            $nsi = new NewsflowSlotItem();
            $this->slots = $nsi->parseResponse($response);
        }

        return $this->slots;
    }
812968
public function toArray()
    {
        $packet = $this->getPacket();

        return array(
            'id'           => (string)$this->id,
            'hostname'     => (string)$packet['hostname'],
            'pid'          => (int)$packet['pid'],

            'queues'       => array(
                'selected' => (array)explode(',', $packet['queues']),
                'resolved' => (array)$this->resolveQueues()
            ),
            'shutdown'     => (bool)$packet['shutdown'],
            'blocking'     => (bool)$packet['blocking'],
            'status'       => (int)$packet['status'],
            'interval'     => (int)$packet['interval'],
            'timeout'      => (int)$packet['timeout'],
            'memory'       => (int)$packet['memory'],
            'memory_limit' => (int)$packet['memory_limit'] * 1024 * 1024,

            'started'      => (float)$packet['started'],
            'processed'    => (int)$packet['processed'],
            'cancelled'    => (int)$packet['cancelled'],
            'failed'       => (int)$packet['failed'],

            'job_id'       => (string)$packet['job_id'],
            'job_pid'      => (int)$packet['job_pid'],
            'job_started'  => (float)$packet['job_started'],
        );
    }
310315
public function fetchAllTables()
    {
        $tables = array();
        $result = $this->pdo->query('SHOW TABLES')->fetchAll();

        foreach ($result as $index => $array) {
            // Extract a value - we don't care about a key
            $data = array_values($array);
            // Its ready not, just append it
            $tables[] = $data[0];
        }

        return $tables;
    }
852741
function getSlots(children) {
  var slots = {};
  if (children == null) {
    return slots
  }
  if (!Array.isArray(children)) {
    children = [children];
  }
  children = children.filter(function (v) { return v != null; });
  children.forEach(function (v, _i) {
    if (typeof v === 'string' || typeof v === 'number' || v === null) {
      slots.default = slots.default || [];
      slots.default.push(v);
    } else if (v.type === COMMON.template.type) {
      slots[v['data-slot']] = slots[v['data-slot']] || [];
      slots[v['data-slot']].push(v.render);
    } else if (v.props) {
      var dataSlot = v.props['data-slot'];
      if (dataSlot == null) {
        slots.default = slots.default || [];
        slots.default.push(v);
      } else {
        slots[dataSlot] = slots[dataSlot] || [];
        slots[dataSlot].push(v);
      }
    }
  });
  return slots
}
903401
public static function getList()
    {
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();
        $libraries = [];
        foreach ($db->fetchAll('select sclHandle from SystemCaptchaLibraries order by sclHandle asc') as $row) {
            $scl = static::getByHandle($row['sclHandle']);
            $libraries[] = $scl;
        }

        return $libraries;
    }
895514
private function getChartOptions(): array
    {
        $groupByField = $this->getGroupByField();
        if (!$groupByField) {
            return [];
        }

        list($plugin, $controller) = pluginSplit($this->entity->get('model'));
        list($prefix, $fieldName) = pluginSplit($groupByField);

        $result = [];
        foreach ($this->charts as $chart) {
            $result[] = [
                'chart' => $chart['type'],
                'icon' => $chart['icon'],
                'id' => Inflector::delimit($chart['type']) . '_' . $this->getTableId(),
                'ajax' => [
                    'url' => Router::url([
                        'plugin' => $plugin,
                        'controller' => $controller,
                        'action' => 'search',
                        $this->entity->get('id')
                    ]),
                    'format' => 'pretty',
                ],
                'options' => [
                    'resize' => true,
                    'hideHover' => true,
                    'labels' => [Inflector::humanize(Search::GROUP_BY_FIELD), Inflector::humanize($fieldName)],
                    'xkey' => [$groupByField],
                    'ykeys' => [$prefix . '.' . Search::GROUP_BY_FIELD]
                ]
            ];
        }

        return $result;
    }
383145
public function getMapCategoriesByBranch() {
    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $locations = $this->getLocations();
    $data = [];
    foreach ($locations as $location_id => $location_name) {
      $link = $this->getUrlFromOpenyProgramsSearchSettings('get_map_categories_by_branch_path', ['{{ branch_id }}' => $location_id]);
      $data[$location_id] = $this->scrapeCategoryList($link);
    }

    $this->cache->set($cid, $data);
    return $data;
  }
211743
public function getList(): array
    {
        $result = [];
        $controllers = Utility::getControllers();

        if (empty($controllers)) {
            return $result;
        }

        foreach ($controllers as $controller) {
            $parts = explode('\\', $controller);
            foreach ($parts as $key => &$part) {
                if ('App' === $part) {
                    unset($parts[$key]);
                    continue;
                }

                $part = str_replace('Controller', '', $part);
                $part = Inflector::humanize(Inflector::underscore($part));
            }

            // remove empty values
            $parts = array_filter($parts);

            $key = App::shortName($controller, 'Controller', 'Controller');
            $value = implode(' - ', $parts);
            $result[$key] = $value;
        }

        // sort by value
        asort($result);

        return $result;
    }