symfony1.3のDoctrineモデルでgetter/setterのPHPDocコメントが生成されるようになった
以前、Doctrine(symfony 1.3 alpha + Doctrine)について調べた時、生成されたモデルクラスに各フィールド値に対応するアクセサメソッドが存在しない、ということを書きました。
私は普段Eclipse + PDTでコード補完に頼りながらコーディングするダメ人間ですが、特にモデルクラスのフィールドへのアクセサが補完されることは重要なポイントでした。
この問題が、symfony 1.3 betaにてPHPDocのコメントがモデルのベースクラスに追加されるようになり、あっさり解決してしまいました。
- http://trac.symfony-project.org/changeset/23314/branches/1.3/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildModelTask.class.php
- [1.3] added doc tags for sfDoctrineRecord magic methods (closes #7064)
実際には、以下のようなコメントが追加で生成されていました。
<?php /* * @method string getName() Returns the current record's "name" value * @method decimal getPrice() Returns the current record's "price" value * @method Doctrine_Collection getPhotos() Returns the current record's "Photos" collection * @method Product setName() Sets the current record's "name" value * @method Product setPrice() Sets the current record's "price" value * @method Product setPhotos() Sets the current record's "Photos" collection */