Adds Permission model and framework for testing permission manager.

This commit is contained in:
Vassyli
2016-10-31 13:28:30 +01:00
parent 94e18b8d11
commit 3bf23f3ac7
15 changed files with 549 additions and 102 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace LotGD\Core\Tests\Ressources\TestModels;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Table;
use LotGD\Core\Models\PermissionableInterface;
use LotGD\Core\Tools\Model\Permissionable;
/**
* @Entity
* @Table("TestUsers")
*/
class User implements PermissionableInterface {
use Permissionable;
/** @Id @Column(type="integer") @GeneratedValue */
private $id;
/** @Column(type="string", length=50); */
private $name;
/** @OneToMany(targetEntity="UserPermissionAssociation", mappedBy="owner", cascade={"persist", "remove"}) */
private $permissions;
public function getId(): int
{
return $this->id;
}
public function getName(): string
{
return $this->name;
}
public function setName(string $name)
{
$this->name = $name;
}
}