1
0
mirror of synced 2025-02-03 13:59:27 +03:00

37 lines
651 B
PHP
Raw Normal View History

<?php
namespace Doctrine\Tests\Models\Cache;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @Entity
* @Table("cache_action")
*/
class Action
{
/**
* @Id
* @Column(type="string")
* @GeneratedValue(strategy="NONE")
*/
public $name;
/**
* @OneToMany(targetEntity="Token", cascade={"persist", "remove"}, mappedBy="action")
*/
public $tokens;
public function __construct($name)
{
$this->name = $name;
$this->tokens = new ArrayCollection();
}
public function addToken(Token $token)
{
$this->tokens[] = $token;
$token->action = $this;
}
}