mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 04:19:44 +01:00
add has lifecycle callbacks
This commit is contained in:
parent
945c354654
commit
788abf5131
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\SOLID\Tests\Rector\Class_\FinalizeClassesWithoutChildrenRector\Fixture;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
* @ORM\Table
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Issue1639
|
||||
{
|
||||
/**
|
||||
* @var Expense
|
||||
*
|
||||
* @ORM\Id
|
||||
* @ORM\ManyToOne(targetEntity="Expense", inversedBy="expenseTags")
|
||||
*/
|
||||
private $expense;
|
||||
|
||||
/**
|
||||
* @var Snowflake
|
||||
*
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="tag_id", type="snowflake")
|
||||
*/
|
||||
private $tagId;
|
||||
|
||||
public function __construct(Expense $expense, Snowflake $tagId)
|
||||
{
|
||||
$this->expense = $expense;
|
||||
$this->tagId = $tagId;
|
||||
}
|
||||
|
||||
public function tagId(): Snowflake
|
||||
{
|
||||
return $this->tagId;
|
||||
}
|
||||
}
|
17
stubs/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php
Normal file
17
stubs/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\ORM\Mapping;
|
||||
|
||||
// mimics @see https://github.com/doctrine/orm/blob/master/lib/Doctrine/ORM/Annotation/HasLifecycleCallbacks.php
|
||||
|
||||
if (class_exists('Doctrine\ORM\Mapping\HasLifecycleCallbacks')) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Annotation
|
||||
* @Target("CLASS")
|
||||
*/
|
||||
final class HasLifecycleCallbacks implements Annotation
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user