diff --git a/cake/console/templates/default/actions/controller_actions.ctp b/cake/console/templates/default/actions/controller_actions.ctp index e6f0f8e83..1b59ba650 100644 --- a/cake/console/templates/default/actions/controller_actions.ctp +++ b/cake/console/templates/default/actions/controller_actions.ctp @@ -18,11 +18,22 @@ */ ?> +/** + * index method + * + * @return void + */ public function index() { $this->->recursive = 0; $this->set('', $this->paginate()); } +/** + * view method + * + * @param string $id + * @return void + */ public function view($id = null) { $this->->id = $id; if (!$this->->exists()) { @@ -32,6 +43,11 @@ } +/** + * add method + * + * @return void + */ public function add() { if ($this->request->is('post')) { $this->->create(); @@ -66,6 +82,12 @@ } +/** + * edit method + * + * @param string $id + * @return void + */ public function edit($id = null) { $this->->id = $id; if (!$this->->exists()) { @@ -104,6 +126,12 @@ ?> } +/** + * delete method + * + * @param string $id + * @return void + */ public function delete($id = null) { if (!$this->request->is('post')) { throw new MethodNotAllowedException(); diff --git a/cake/console/templates/default/classes/controller.ctp b/cake/console/templates/default/classes/controller.ctp index 0fd02078b..f4dc9c9eb 100644 --- a/cake/console/templates/default/classes/controller.ctp +++ b/cake/console/templates/default/classes/controller.ctp @@ -21,13 +21,23 @@ echo " +/** + * Controller + * + */ class Controller extends AppController { +/** + * Scaffold + * + * @var mixed + */ public $scaffold; /* Fixture generated on: */ + +/** + * Fixture + * + */ class Fixture extends CakeTestFixture { +/** + * Table name + * + * @var string + */ public $table = ''; +/** + * Import + * + * @var array + */ public $import = ; +/** + * Fields + * + * @var array + */ public $fields = ; +/** + * Records + * + * @var array + */ public $records = ; } diff --git a/cake/console/templates/default/classes/model.ctp b/cake/console/templates/default/classes/model.ctp index e0ffb50de..f824e8a16 100644 --- a/cake/console/templates/default/classes/model.ctp +++ b/cake/console/templates/default/classes/model.ctp @@ -20,22 +20,43 @@ */ echo " +/** + * Model + * + */ class extends AppModel { +/** + * Use database config + * + * @var string + */ public $useDbConfig = ''; +/** + * Primary key field + * + * @var string + */ public $primaryKey = ''; +/** + * Display field + * + * @var string + */ public $displayField = ''; $validations): echo "\t\t'$field' => array(\n"; @@ -57,6 +78,7 @@ endif; foreach ($associations as $assoc): if (!empty($assoc)): ?> + //The Associations below have been created with all possible keys, those that are not needed can be removed $relation): $out = "\n\t\t'{$relation['alias']}' => array(\n"; @@ -86,6 +109,7 @@ endforeach; if (!empty($associations['hasMany'])): $belongsToCount = count($associations['hasMany']); + echo "\n/**\n * hasMany associations\n *\n * @var array\n */"; echo "\n\tpublic \$hasMany = array("; foreach ($associations['hasMany'] as $i => $relation): $out = "\n\t\t'{$relation['alias']}' => array(\n"; @@ -111,6 +135,7 @@ endif; if (!empty($associations['hasAndBelongsToMany'])): $habtmCount = count($associations['hasAndBelongsToMany']); + echo "\n/**\n * hasAndBelongsToMany associations\n *\n * @var array\n */"; echo "\n\tpublic \$hasAndBelongsToMany = array("; foreach ($associations['hasAndBelongsToMany'] as $i => $relation): $out = "\n\t\t'{$relation['alias']}' => array(\n"; diff --git a/cake/console/templates/default/classes/test.ctp b/cake/console/templates/default/classes/test.ctp index 6e8c1ba76..1b6a70653 100644 --- a/cake/console/templates/default/classes/test.ctp +++ b/cake/console/templates/default/classes/test.ctp @@ -23,30 +23,71 @@ echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:i:s') . " : App::import('', ''); +/** + * Test + * + */ class Test extends { +/** + * Auto render + * + * @var boolean + */ public $autoRender = false; +/** + * Redirect action + * + * @param mixed $url + * @param mixed $status + * @param boolean $exit + * @return void + */ public function redirect($url, $status = null, $exit = true) { $this->redirectUrl = $url; } } +/** + * Test Case + * + */ class TestCase extends CakeTestCase { +/** + * Fixtures + * + * @var array + */ public $fixtures = array(''); +/** + * startTest method + * + * @return void + */ public function startTest() { $this-> } +/** + * endTest method + * + * @return void + */ public function endTest() { unset($this->); ClassRegistry::flush(); } +/** + * test method + * + * @return void + */ public function test() { }