mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
sf4 deprecated: migrate Doctrine ORM mapping to annotation
This commit is contained in:
@@ -21,64 +21,85 @@
|
||||
|
||||
namespace Chill\CustomFieldsBundle\Entity;
|
||||
|
||||
use \Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* CustomFieldGroup
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(null)
|
||||
*/
|
||||
class CustomFieldsGroup
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(type="json_array")
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
private $entity;
|
||||
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\Collection $customFields: The custom
|
||||
* fields of the group. The custom fields are asc-ordered regarding to their
|
||||
* property "ordering".
|
||||
* The custom fields of the group.
|
||||
* The custom fields are asc-ordered regarding to their property "ordering".
|
||||
*
|
||||
* @var Collection $customFields
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomField",
|
||||
* mappedBy="customFieldGroup")
|
||||
* @ORM\OrderBy({"ordering" = "ASC"})
|
||||
*/
|
||||
private $customFields;
|
||||
|
||||
/**
|
||||
* @var array(customField) | null $activeCustomFields: The custom fields
|
||||
* of the group that are active. This variable if null, if this
|
||||
* informations has not been computed.
|
||||
* The custom fields of the group that are active.
|
||||
* This variable if null, if this informations has not been computed.
|
||||
*
|
||||
* @var array|null
|
||||
*/
|
||||
private $activeCustomFields = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(type="json_array")
|
||||
*/
|
||||
private $options = array();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* CustomFieldsGroup constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->customFields = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->customFields = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add customField
|
||||
*
|
||||
* @param \Chill\CustomFieldsBundle\Entity\CustomField $customField
|
||||
*
|
||||
* @param CustomField $customField
|
||||
* @return CustomFieldsGroup
|
||||
*/
|
||||
public function addCustomField(\Chill\CustomFieldsBundle\Entity\CustomField $customField)
|
||||
public function addCustomField(CustomField $customField)
|
||||
{
|
||||
$this->customFields[] = $customField;
|
||||
|
||||
@@ -88,16 +109,15 @@ class CustomFieldsGroup
|
||||
/**
|
||||
* Remove customField
|
||||
*
|
||||
* @param \Chill\CustomFieldsBundle\Entity\CustomField $customField
|
||||
* @param CustomField $customField
|
||||
*/
|
||||
public function removeCustomField(\Chill\CustomFieldsBundle\Entity\CustomField $customField)
|
||||
public function removeCustomField(CustomField $customField)
|
||||
{
|
||||
$this->customFields->removeElement($customField);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
* @return Collection
|
||||
*/
|
||||
public function getCustomFields()
|
||||
{
|
||||
@@ -107,7 +127,7 @@ class CustomFieldsGroup
|
||||
/**
|
||||
* Get all the custom
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
* @return Collection
|
||||
*/
|
||||
public function getActiveCustomFields()
|
||||
{
|
||||
@@ -122,7 +142,6 @@ class CustomFieldsGroup
|
||||
|
||||
return $this->activeCustomFields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
@@ -138,7 +157,6 @@ class CustomFieldsGroup
|
||||
* Set name
|
||||
*
|
||||
* @param array $name
|
||||
*
|
||||
* @return CustomFieldsGroup
|
||||
*/
|
||||
public function setName($name)
|
||||
@@ -178,7 +196,6 @@ class CustomFieldsGroup
|
||||
* Set entity
|
||||
*
|
||||
* @param string $entity
|
||||
*
|
||||
* @return CustomFieldsGroup
|
||||
*/
|
||||
public function setEntity($entity)
|
||||
@@ -212,7 +229,7 @@ class CustomFieldsGroup
|
||||
* set options array
|
||||
*
|
||||
* @param array $options
|
||||
* @return \Chill\CustomFieldsBundle\Entity\CustomFieldsGroup
|
||||
* @return CustomFieldsGroup
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
|
Reference in New Issue
Block a user