Skip to content

Commit

Permalink
Update findOne model overrides: nullable return
Browse files Browse the repository at this point in the history
  • Loading branch information
nederdirk committed Jan 22, 2021
1 parent 91a1478 commit 96c72a2
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 96c72a2

Please sign in to comment.