/** * @param \Spryker\Zed\Gui\Communication\Table\TableConfiguration $config * * @return array */ protected function prepareData(TableConfiguration $config) { $query = $this->aclGroupQuery->leftJoinSpyAclGroupsHasRoles()->groupByIdAclGroup()->withColumn('COUNT(fk_acl_role)', self::ROLES); $groupCollection = $this->runQuery($query, $config); $groups = []; foreach ($groupCollection as $group) { $groups[] = [SpyAclGroupTableMap::COL_NAME => $group[SpyAclGroupTableMap::COL_NAME], SpyAclGroupTableMap::COL_CREATED_AT => $this->dateFormatter->dateTime($group[SpyAclGroupTableMap::COL_CREATED_AT]), self::ROLES => $this->createRoleUrl($group), self::EDIT => $this->createEditUrl($group)]; } return $groups; }
/** * @param \Spryker\Zed\Gui\Communication\Table\TableConfiguration $config * * @return array */ protected function prepareData(TableConfiguration $config) { $roleQuery = $this->aclQueryContainer->queryRole(); $queryResults = $this->runQuery($roleQuery, $config); $results = []; foreach ($queryResults as $rule) { $results[] = [SpyAclRoleTableMap::COL_CREATED_AT => $this->dateFormatter->dateTime($rule[SpyAclRoleTableMap::COL_CREATED_AT]), SpyAclRoleTableMap::COL_NAME => $rule[SpyAclRoleTableMap::COL_NAME], self::ACTION => implode(' ', $this->createTableActions($rule))]; } return $results; }
/** * @param \Spryker\Zed\Gui\Communication\Table\TableConfiguration $config * * @return array */ protected function prepareData(TableConfiguration $config) { $result = []; $queryResult = $this->runQuery($this->taxSetQuery, $config, true); /** @var \Orm\Zed\Tax\Persistence\SpyTaxSet $taxSetEntity */ foreach ($queryResult as $taxSetEntity) { $result[] = [SpyTaxSetTableMap::COL_ID_TAX_SET => $taxSetEntity->getIdTaxSet(), SpyTaxSetTableMap::COL_NAME => $taxSetEntity->getName(), SpyTaxSetTableMap::COL_CREATED_AT => $this->dateFormatter->dateTime($taxSetEntity->getCreatedAt()), self::TABLE_COL_ACTIONS => $this->getActionButtons($taxSetEntity)]; } return $result; }
/** * @param \Spryker\Zed\Gui\Communication\Table\TableConfiguration $config * * @return array */ protected function prepareData(TableConfiguration $config) { $userQuery = $this->userQueryContainer->queryUser(); $queryResults = $this->runQuery($userQuery, $config); $results = []; foreach ($queryResults as $item) { $results[] = [SpyUserTableMap::COL_USERNAME => $item[SpyUserTableMap::COL_USERNAME], SpyUserTableMap::COL_FIRST_NAME => $item[SpyUserTableMap::COL_FIRST_NAME], SpyUserTableMap::COL_LAST_NAME => $item[SpyUserTableMap::COL_LAST_NAME], SpyUserTableMap::COL_LAST_LOGIN => $this->dateFormatter->dateTime($item[SpyUserTableMap::COL_LAST_LOGIN]), SpyUserTableMap::COL_STATUS => $this->createStatusLabel($item), self::ACTION => implode(' ', $this->createActionButtons($item))]; } return $results; }
/** * @param \Orm\Zed\Customer\Persistence\SpyCustomer $customer * * @return array */ protected function hydrateCustomerListRow(SpyCustomer $customer) { $customerRow = $customer->toArray(); $customerRow[self::COL_FK_COUNTRY] = $this->getCountryNameByCustomer($customer); $customerRow[self::COL_CREATED_AT] = $this->dateFormatter->dateTime($customer->getCreatedAt()); $customerRow[self::ACTIONS] = $this->buildLinks($customer); return $customerRow; }
/** * @param \Spryker\Zed\Gui\Communication\Table\TableConfiguration $config * * @return array */ protected function prepareData(TableConfiguration $config) { $query = $this->buildQuery(); $queryResults = $this->runQuery($query, $config); $results = []; foreach ($queryResults as $item) { $results[] = [SpySalesOrderTableMap::COL_ID_SALES_ORDER => $item[SpySalesOrderTableMap::COL_ID_SALES_ORDER], SpySalesOrderTableMap::COL_ORDER_REFERENCE => $item[SpySalesOrderTableMap::COL_ORDER_REFERENCE], SpySalesOrderTableMap::COL_CREATED_AT => $this->dateFormatter->dateTime($item[SpySalesOrderTableMap::COL_CREATED_AT]), SpySalesOrderTableMap::COL_FK_CUSTOMER => $this->formatCustomer($item), SpySalesOrderTableMap::COL_EMAIL => $item[SpySalesOrderTableMap::COL_EMAIL], SpySalesOrderTableMap::COL_FIRST_NAME => $item[SpySalesOrderTableMap::COL_FIRST_NAME], self::GRAND_TOTAL => $this->formatPrice($this->getGrandTotalByIdSalesOrder($item[SpySalesOrderTableMap::COL_ID_SALES_ORDER])), self::URL => implode(' ', $this->createActionUrls($item))]; } unset($queryResults); return $results; }
/** * @param string $date * @param string|null $timezone * * @return string */ public function formatDateTime($date, $timezone = null) { return $this->dateFormatter->dateTime($date, $this->convertDateTimeZone($timezone)); }
/** * @param string $date * * @return bool|string */ protected function formatDate($date) { return $this->dateFormatter->dateTime($date); }