Skip to content

Commit b9bdf26

Browse files
committed
Make sure propel generates correct doc block
1 parent de1ac9e commit b9bdf26

File tree

5 files changed

+296
-281
lines changed

5 files changed

+296
-281
lines changed

lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ protected function addTemporalAccessor(&$script, $col)
346346
* ".$col->getDescription()."
347347
* @param string \$format The date/time format string (either date()-style or strftime()-style).
348348
* If format is NULL, then the integer unix timestamp will be returned.
349-
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
349+
* @return false|int|string|null Formatted date/time value as string or integer unix timestamp (if format is NULL).
350350
* @throws PropelException - if unable to convert the date/time to timestamp.
351351
*/
352352
public function get$cfc(\$format = ".var_export($defaultfmt, true)."";
@@ -399,7 +399,7 @@ protected function addGenericAccessor(&$script, $col)
399399
/**
400400
* Get the [$clo] column value.
401401
* ".$col->getDescription()."
402-
* @return ".$col->getPhpNative()."
402+
* @return ".$col->getPhpNative(). $col->isNotNull() ? "" : "|null
403403
*/
404404
public function get$cfc(";
405405
if ($col->isLazyLoad()) $script .= "\$con = null";
@@ -500,12 +500,12 @@ protected function addMutatorOpen(&$script, Column $col)
500500
* ".$col->getDescription()."
501501
* @param ".$col->getPhpNative()." \$v new value
502502
* @return void";
503-
503+
504504
if ($throwsPropelException){
505505
$script .= "
506506
* @throws PropelException";
507507
}
508-
508+
509509
$script .= "
510510
*/
511511
public function set$cfc(\$v)
@@ -635,10 +635,10 @@ protected function addDefaultMutator(&$script, Column $col)
635635
}
636636

637637
$this->addMutatorOpen($script, $col);
638-
638+
639639
// Perform some smart checking here to handle possible type discrepancies
640640
// between the passed-in value and the value from the DB
641-
641+
642642
if ($col->getPhpNative() === "int") {
643643
$script .= "
644644
// Since the native PHP type for this column is integer,
@@ -656,7 +656,7 @@ protected function addDefaultMutator(&$script, Column $col)
656656
}
657657
";
658658
}
659-
659+
660660
$script .= "
661661
if (\$this->$clo !== \$v";
662662
if ($defaultValue !== null) {
@@ -811,7 +811,8 @@ protected function addToArray(&$script)
811811
*
812812
* @param string \$keyType One of the class type constants TYPE_PHPNAME,
813813
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
814-
* @return mixed[string] an associative array containing the field names (as keys) and field values
814+
* @return array an associative array containing the field names (as keys) and field values
815+
* @throws PropelException
815816
*/
816817
public function toArray(\$keyType = BasePeer::TYPE_PHPNAME)
817818
{
@@ -839,6 +840,7 @@ protected function addGetByName(&$script)
839840
* one of the class type constants TYPE_PHPNAME,
840841
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
841842
* @return mixed Value of field.
843+
* @throws PropelException
842844
*/
843845
public function getByName(\$name, \$type = BasePeer::TYPE_PHPNAME)
844846
{
@@ -894,6 +896,7 @@ protected function addSetByName(&$script)
894896
* one of the class type constants TYPE_PHPNAME,
895897
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
896898
* @return void
899+
* @throws PropelException
897900
*/
898901
public function setByName(\$name, \$value, \$type = BasePeer::TYPE_PHPNAME)
899902
{
@@ -914,6 +917,7 @@ protected function addSetByPosition(&$script)
914917
* @param int \$pos position in xml schema
915918
* @param mixed \$value field value
916919
* @return void
920+
* @throws PropelException
917921
*/
918922
public function setByPosition(\$pos, \$value)
919923
{
@@ -953,6 +957,7 @@ protected function addFromArray(&$script)
953957
* @param array \$arr An array to populate the object from.
954958
* @param string \$keyType The type of keys the array uses.
955959
* @return void
960+
* @throws PropelException
956961
*/
957962
public function fromArray(\$arr, \$keyType = BasePeer::TYPE_PHPNAME)
958963
{

lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5BasicPeerBuilder.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,14 @@ public function addInheritanceColumnConstants(&$script)
406406
/** A key representing a particular subclass */
407407
const CLASSKEY_".strtoupper($child->getKey())." = '" . $child->getKey() . "';
408408
";
409-
409+
410410
if (strtoupper($child->getClassname()) != strtoupper($child->getKey())) {
411411
$script .= "
412412
/** A key representing a particular subclass */
413413
const CLASSKEY_".strtoupper($child->getClassname())." = '" . $child->getKey() . "';
414414
";
415415
}
416-
416+
417417
$script .= "
418418
/** A class that can be returned by this peer. */
419419
const CLASSNAME_".strtoupper($child->getKey())." = '". $childBuilder->getClasspath() . "';
@@ -530,6 +530,8 @@ protected function addDoCount(&$script)
530530
* @param boolean \$distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
531531
* @param Connection \$con
532532
* @return int Number of matching rows.
533+
* @throws PropelException
534+
* @throws SQLException
533535
*/
534536
public static function doCount(Criteria \$criteria, \$distinct = false, \$con = null)
535537
{
@@ -572,9 +574,9 @@ protected function addDoSelectOne(&$script)
572574
*
573575
* @param Criteria \$criteria object used to create the SELECT statement.
574576
* @param Connection \$con
575-
* @return ".$this->getTable()->getPhpName()."
576-
* @throws PropelException Any exceptions caught during processing will be
577-
* rethrown wrapped into a PropelException.
577+
* @return ".$this->getTable()->getPhpName()."|null
578+
* @throws PropelException
579+
* @throws SQLException
578580
*/
579581
public static function doSelectOne(Criteria \$criteria, \$con = null)
580582
{
@@ -602,8 +604,8 @@ protected function addDoSelect(&$script)
602604
* @param Criteria \$criteria The Criteria object used to build the SELECT statement.
603605
* @param Connection \$con
604606
* @return {$className}[] Array of selected Objects
605-
* @throws PropelException Any exceptions caught during processing will be
606-
* rethrown wrapped into a PropelException.
607+
* @throws PropelException
608+
* @throws SQLException
607609
*/
608610
public static function doSelect(Criteria \$criteria, \$con = null)
609611
{
@@ -667,8 +669,8 @@ protected function addPopulateObjects(&$script)
667669
*
668670
* @param Resultset \$rs
669671
* @return ".$table->getPhpName()."[]
670-
* @throws PropelException Any exceptions caught during processing will be
671-
* rethrown wrapped into a PropelException.
672+
* @throws PropelException
673+
* @throws SQLException
672674
*/
673675
public static function populateObjects(ResultSet \$rs)
674676
{
@@ -1276,6 +1278,7 @@ protected function addDoValidate(&$script)
12761278
* @param mixed \$cols Column name or array of column names.
12771279
*
12781280
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
1281+
* @throws PropelException
12791282
*/
12801283
public static function doValidate(Base".$table->getPhpName()." \$obj, \$cols = null)
12811284
{
@@ -1329,7 +1332,9 @@ protected function addRetrieveByPK_SinglePK(&$script)
13291332
*
13301333
* @param mixed \$pk the primary key.
13311334
* @param Connection \$con the connection to use
1332-
* @return $className
1335+
* @return $className|null
1336+
* @throws PropelException
1337+
* @throws SQLException
13331338
*/
13341339
public static function ".$this->getRetrieveMethodName()."(\$pk, \$con = null)
13351340
{
@@ -1380,8 +1385,8 @@ protected function addRetrieveByPKs_SinglePK(&$script)
13801385
* @param array \$pks List of primary keys
13811386
* @param Connection \$con the connection to use
13821387
* @return {$className}[]
1383-
* @throws PropelException Any exceptions caught during processing will be
1384-
* rethrown wrapped into a PropelException.
1388+
* @throws PropelException
1389+
* @throws SQLException
13851390
*/
13861391
public static function ".$this->getRetrieveMethodName()."s(\$pks, \$con = null)
13871392
{

lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ComplexObjectBuilder.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ protected function addFKMutator(&$script, ForeignKey $fk)
296296
/**
297297
* Declares an association between this object and a $className object.
298298
*
299-
* @param Base$className \$v
299+
* @param Base$className|null \$v
300300
* @return void
301301
* @throws PropelException
302302
*/
@@ -523,9 +523,10 @@ protected function addRefFKGetJoinMethods(&$script, ForeignKey $refFK)
523523
* api reasonable. You can provide public methods for those you
524524
* actually need in ".$table->getPhpName().".
525525
*
526-
* @param Criteria \$criteria
527-
* @param Connection \$con
526+
* @param Criteria|null \$criteria
527+
* @param Connection|null \$con
528528
* @return ".$className."[] $relCol joined with $relCol2
529+
* @throws PropelException
529530
*/
530531
public function get".$relCol."Join".$relCol2."(Criteria \$criteria = null, Connection \$con = null)
531532
{
@@ -714,7 +715,6 @@ protected function addRefFKCount(&$script, ForeignKey $refFK)
714715
* @param boolean \$distinct
715716
* @param Connection \$con
716717
* @return int The number of $relCol
717-
* @throws PropelException
718718
*/
719719
public function count$relCol(\$criteria = null, \$distinct = false, \$con = null)
720720
{
@@ -769,9 +769,8 @@ protected function addRefFKGet(&$script, ForeignKey $refFK)
769769
* an empty collection or the current collection, the criteria
770770
* is ignored on a new object.
771771
*
772-
* @param Connection \$con
773-
* @param Criteria \$criteria
774-
* @throws PropelException
772+
* @param Connection|null \$con
773+
* @param Criteria|null \$criteria
775774
* @return ".$className."[] $relCol
776775
*/
777776
public function get$relCol(\$criteria = null, \$con = null)

lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ComplexPeerBuilder.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected function addDoSelectJoin(&$script)
9797
// the join table will be aliases when
9898
// this table == foreign table
9999
$alias = $fk->getForeignTableName() == $table->getName() ? 'alias' : null;
100-
100+
101101
$joinClassName = $joinTable->getPhpName();
102102

103103
$thisTableObjectBuilder = OMBuilder::getNewObjectBuilder($table);
@@ -244,6 +244,8 @@ protected function addDoCountJoin(&$script)
244244
* @param boolean \$distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
245245
* @param Connection \$con
246246
* @return int Number of matching rows.
247+
* @throws PropelException
248+
* @throws SQLException
247249
*/
248250
public static function doCountJoin".$thisTableObjectBuilder->getFKPhpNameAffix($fk, $plural = false)."(Criteria \$criteria, \$distinct = false, \$con = null)
249251
{
@@ -493,6 +495,8 @@ protected function addDoCountJoinAll(&$script)
493495
* @param boolean \$distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
494496
* @param Connection \$con
495497
* @return int Number of matching rows.
498+
* @throws PropelException
499+
* @throws SQLException
496500
*/
497501
public static function doCountJoinAll(Criteria \$criteria, \$distinct = false, \$con = null)
498502
{

0 commit comments

Comments
 (0)