sf4 deprecated: migrate Doctrine ORM mapping to annotation

This commit is contained in:
2020-07-24 20:20:07 +02:00
parent c69d6d6bb8
commit 6ccfa8a130
8 changed files with 101 additions and 123 deletions

View File

@@ -1,7 +1,6 @@
<?php
/*
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -20,36 +19,60 @@
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* ActivityReasonCategory
* Class ActivityReasonCategory
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity()
* @ORM\Table(null)
* @ORM\HasLifecycleCallbacks()
*/
class ActivityReasonCategory
{
/**
* @var integer
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
* @ORM\Column(type="json_array")
*/
private $name;
/**
* @var boolean
* @ORM\Column(type="boolean")
*/
private $active = true;
/** @var ArrayCollection array of ActivityReason */
/**
* Array of ActivityReason
* @var ArrayCollection
* @ORM\OneToMany(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReason",
* mappedBy="category")
*/
private $reasons;
/**
* ActivityReasonCategory constructor.
*/
public function __construct()
{
$this->reasons = new ArrayCollection();
}
/**
* @return string
*/
public function __toString()
{
return 'ActivityReasonCategory('.$this->getName('x').')';
@@ -69,7 +92,6 @@ class ActivityReasonCategory
* Set name
*
* @param array $name
*
* @return ActivityReasonCategory
*/
public function setName($name)