/** * * @param object $paData */ public function setData($poData) { if ($poData instanceof Traversable) { $laData = ArrayUtils::iteratorToArray($poData); } else { $laData = $poData; } if (is_array($laData)) { foreach ($laData as $lsProperty => $lmValue) { if (substr($lsProperty, 0, 2) === 'dt') { $lmValue = Translator::dateP2S($lmValue); $laData[$lsProperty] = trim($lmValue); } } } parent::setData($laData); }
/** * * @param array $paParams */ public function gridList($paParams) { $laParams['User_id'] = $this->request('User_id', null); $laParams['stIP'] = $this->request('stIP', null); $laParamsDt['dtPeriodInit'] = Translator::dateP2S($this->request('dtPeriodInit', date('Y-m-d', time()))); // - 60*60*24))); $laParamsDt['dtPeriodEnd'] = Translator::dateP2S($this->request('dtPeriodEnd', date('Y-m-d', time()))); // - 60*60*24))); if (!empty($laParamsDt['dtPeriodInit'])) { $paParams['dtPeriodInit'] = $laParamsDt['dtPeriodInit'] . " 00:00:00"; } if (!empty($laParamsDt['dtPeriodEnd'])) { $paParams['dtPeriodEnd'] = $laParamsDt['dtPeriodEnd'] . " 23:59:59"; } foreach ($laParams as $lsItem => $lsValue) { if ($lsValue !== null && $lsValue !== '') { $paParams[$lsItem] = $lsValue; } else { $paParams[$lsItem] = ""; } } //debug::display($paParams); $laResult = $this->getEntityManager()->getRepository($this->_sEntityExtended)->getList($paParams, false); return $laResult; }