Skip to content

Commit

Permalink
Do not declare type of entity
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Oct 13, 2024
1 parent 34faf5a commit 0671af0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
12 changes: 11 additions & 1 deletion TODO.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
multi relations in model
classidy should return class argument without type-hint
fix incorrect return type in repository (no "\")
pagination template if bootstrap
pagination template if bootstrap

------

/**
* @ManyToOne(targetEntity="User", cascade={"persist"})
* @JoinColumn(name="user_id", referencedColumnName="id", nullable=true, unique=false)
*
* @var \User|null
*/
protected $user = null;
3 changes: 2 additions & 1 deletion src/Template/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ protected function setSetMethod($table)

$method->setReturn($model);
$method->addArrayArgument('data', 'array<string, mixed>');
$method->addClassArgument('entity', $model);
$method->addClassArgument('entity', $model)
->withoutTypeDeclared();
$method->addIntegerArgument('id', true);

$cols = $this->cols;
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixture/Plates/Doctrine/Repos/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function exists($data, $id = null)
*
* @return User
*/
public function set($data, \User $entity, $id = null)
public function set($data, $entity, $id = null)
{
// List editable fields from table ---
/** @var string */
Expand Down

0 comments on commit 0671af0

Please sign in to comment.