
now api has ability to set per user role ( group ) which fields is allowed to edit per role and per entity Change-Id: I824ede72dfe9e68b55531a8d2685aa911cb3270e
162 lines
3.2 KiB
PHP
162 lines
3.2 KiB
PHP
<?php namespace models\main;
|
|
|
|
/**
|
|
* Copyright 2016 OpenStack Foundation
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
**/
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\ORM\Mapping AS ORM;
|
|
use models\utils\SilverstripeBaseModel;
|
|
/**
|
|
* @ORM\Entity(repositoryClass="repositories\main\DoctrineGroupRepository")
|
|
* @ORM\Table(name="`Group`")
|
|
* Class Group
|
|
* @package models\main
|
|
*/
|
|
class Group extends SilverstripeBaseModel
|
|
{
|
|
|
|
public function __construct(){
|
|
parent::__construct();
|
|
$this->members = new ArrayCollection();
|
|
$this->groups = new ArrayCollection();
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getTitle()
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
/**
|
|
* @param string $title
|
|
*/
|
|
public function setTitle($title)
|
|
{
|
|
$this->title = $title;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getDescription()
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
/**
|
|
* @param string $description
|
|
*/
|
|
public function setDescription($description)
|
|
{
|
|
$this->description = $description;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getCode()
|
|
{
|
|
return $this->code;
|
|
}
|
|
|
|
/**
|
|
* @param string $code
|
|
*/
|
|
public function setCode($code)
|
|
{
|
|
$this->code = $code;
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getMembers()
|
|
{
|
|
return $this->members;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $members
|
|
*/
|
|
public function setMembers($members)
|
|
{
|
|
$this->members = $members;
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getParent()
|
|
{
|
|
return $this->parent;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $parent
|
|
*/
|
|
public function setParent($parent)
|
|
{
|
|
$this->parent = $parent;
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getGroups()
|
|
{
|
|
return $this->groups;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $groups
|
|
*/
|
|
public function setGroups($groups)
|
|
{
|
|
$this->groups = $groups;
|
|
}
|
|
|
|
/**
|
|
* @ORM\Column(name="Title", type="string")
|
|
* @var string
|
|
*/
|
|
private $title;
|
|
|
|
/**
|
|
* @ORM\Column(name="Description", type="string")
|
|
* @var string
|
|
*/
|
|
private $description;
|
|
|
|
/**
|
|
* @ORM\Column(name="Code", type="string")
|
|
* @var string
|
|
*/
|
|
private $code;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity="models\main\Member", mappedBy="groups")
|
|
*/
|
|
private $members;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Group", inversedBy="groups")
|
|
* @ORM\JoinColumn(name="ParentID", referencedColumnName="ID")
|
|
*/
|
|
private $parent;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Group", mappedBy="parent")
|
|
*/
|
|
private $groups;
|
|
} |