Skip to content

Commit

Permalink
Merge pull request #1697 from nederdirk/findOne-override-declaration-…
Browse files Browse the repository at this point in the history
…nullable

Update findOne model overrides: nullable return
  • Loading branch information
dereuromark authored Jan 22, 2021
2 parents 91a1478 + 96c72a2 commit 540769c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Propel/Generator/Builder/Om/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ protected function addClassOpen(&$script)

// override the signature of ModelCriteria::findOne() to specify the class of the returned object, for IDE completion
$script .= "
* @method $modelClass findOne(ConnectionInterface \$con = null) Return the first $modelClass matching the query
* @method $modelClass|null findOne(ConnectionInterface \$con = null) Return the first $modelClass matching the query
* @method $modelClass findOneOrCreate(ConnectionInterface \$con = null) Return the first $modelClass matching the query, or a new $modelClass object populated from the query conditions when no match is found
*";

// magic findBy() methods, for IDE completion
foreach ($this->getTable()->getColumns() as $column) {
$script .= "
* @method $modelClass findOneBy" . $column->getPhpName() . '(' . $column->getPhpType() . ' $' . $column->getName() . ") Return the first $modelClass filtered by the " . $column->getName() . ' column';
* @method $modelClass|null findOneBy" . $column->getPhpName() . '(' . $column->getPhpType() . ' $' . $column->getName() . ") Return the first $modelClass filtered by the " . $column->getName() . ' column';
}

$script .= " * \n";
Expand Down

0 comments on commit 540769c

Please sign in to comment.