public function loadModel($id) { if (($model = TableMarkup::model()->findByPk($id)) === null) { throw new CHttpException(404, 'Страница не найдена'); } return $model; }
/** * Определение ячеек, заданных в объекте разметки */ protected function _detectPlaces($markupPlaces) { if (!is_array($markupPlaces) || empty($markupPlaces)) { $markupPlaces = array_keys(TableMarkup::model()->placeList); } $places = array(); foreach ($markupPlaces as $place) { if (preg_match("|([0-9]){1}000N|", $place, $matches)) { $places[] = $matches[1] . "00" . ($this->numCurrentLuckColumn < 10 ? "0" : "") . $this->numCurrentLuckColumn; } // Конкретная ячейка if (is_numeric($place)) { $places[] = (int) $place; } } return $places; }