/** * Data provider for the template. Overridden to include records if needed. * * @return array */ public function templateData() { $templateData = parent::templateData(); if (!empty($this->params['records'])) { $modelName = Inflector::camelize($templateData['table']); $data = $this->SeedGenerate->getRecordsFromTable($modelName, $templateData['table'])->toArray(); if (!empty($data)) { $templateData['records'] = $this->stringifyRecords($data); #debug($templateData);exit; } } return $templateData; }