jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Libraries/] [Security/] [Model/] [MySQL/] [Group.php] - Rev 2

Compare with Previous - Blame - Download


<?php

namespace Phem\Libraries\Security\Model\MySQL;

use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\JoinTable;
use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\ORM\Mapping\OneToMany;
use Phem\Libraries\Security\Model\Common\Group as CommonGroup;

/**
 * @Entity @Table(name="admin_group") 
 */
class Group extends CommonGroup
{

    /** @Id @Column(type="integer") @GeneratedValue */
    protected $id;

    /** @Column(type="string") */
    protected $name;

    /** @Column(type="string") */
    protected $description;

    /**
     * @ManyToMany(targetEntity="User")
     * @JoinTable(name="admin_membership",
     *      joinColumns={@JoinColumn(name="groupId", referencedColumnName="id")},
     *      inverseJoinColumns={@JoinColumn(name="user", referencedColumnName="id")}
     *      )
     */
    protected $users;

    /**
     * @OneToMany(targetEntity="Permission", mappedBy="group",cascade={"all"})
     */
    protected $permissions;

    public function getUsers()
    {
        return $this->users;
    }

    public function setUsers($users)
    {
        $this->users = $users;
    }

    public function getPermissions()
    {
        return $this->permissions;
    }

    public function setPermissions($permissions)
    {
        $this->permissions = $permissions;
    }

    public function getId()
    {
        return $this->id;
    }

    public function setId($id)
    {
        $this->id = $id;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function getDescription()
    {
        return $this->description;
    }

    public function setDescription($description)
    {
        $this->description = $description;
    }

}

Powered by WebSVN 2.2.1