mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
Remove deprecation (Event).
This commit is contained in:
parent
c019da9bcf
commit
92b6f4e206
@ -17,57 +17,57 @@
|
|||||||
*/
|
*/
|
||||||
namespace Chill\PersonBundle\Actions;
|
namespace Chill\PersonBundle\Actions;
|
||||||
|
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event triggered when an entity attached to a person is removed.
|
* Event triggered when an entity attached to a person is removed.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class ActionEvent extends Event
|
class ActionEvent implements Event
|
||||||
{
|
{
|
||||||
const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY';
|
const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY';
|
||||||
const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY';
|
const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $personId;
|
protected $personId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the FQDN class name as recorded in doctrine
|
* the FQDN class name as recorded in doctrine
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $entity;
|
protected $entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* an array of key value data to describe the movement
|
* an array of key value data to describe the movement
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $metadata;
|
protected $metadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the sql statement
|
* the sql statement
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $sqlStatement;
|
protected $sqlStatement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $preSql = [];
|
protected $preSql = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $postSql = [];
|
protected $postSql = [];
|
||||||
|
|
||||||
public function __construct($personId, $entity, $sqlStatement, $metadata = [])
|
public function __construct($personId, $entity, $sqlStatement, $metadata = [])
|
||||||
{
|
{
|
||||||
$this->personId = $personId;
|
$this->personId = $personId;
|
||||||
@ -77,7 +77,7 @@ class ActionEvent extends Event
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public function getPreSql(): array
|
public function getPreSql(): array
|
||||||
@ -86,7 +86,7 @@ class ActionEvent extends Event
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public function getPostSql(): array
|
public function getPostSql(): array
|
||||||
@ -105,7 +105,7 @@ class ActionEvent extends Event
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add Sql which will be executed **after** the delete statement
|
* Add Sql which will be executed **after** the delete statement
|
||||||
*
|
*
|
||||||
* @param type $postSql
|
* @param type $postSql
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
@ -122,22 +122,22 @@ class ActionEvent extends Event
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* get the entity name, as recorded in doctrine
|
* get the entity name, as recorded in doctrine
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getEntity(): string
|
public function getEntity(): string
|
||||||
{
|
{
|
||||||
return $this->entity;
|
return $this->entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSqlStatement()
|
public function getSqlStatement()
|
||||||
{
|
{
|
||||||
return $this->sqlStatement;
|
return $this->sqlStatement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMetadata()
|
public function getMetadata()
|
||||||
{
|
{
|
||||||
return $this->metadata;
|
return $this->metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,11 +22,10 @@ namespace Chill\PersonBundle\Privacy;
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
|
||||||
use Chill\PersonBundle\Entity\Person;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
class AccompanyingPeriodPrivacyEvent extends Event
|
class AccompanyingPeriodPrivacyEvent implements Event
|
||||||
{
|
{
|
||||||
public const ACCOMPANYING_PERIOD_PRIVACY_EVENT = 'chill_person.accompanying_period_privacy_event';
|
public const ACCOMPANYING_PERIOD_PRIVACY_EVENT = 'chill_person.accompanying_period_privacy_event';
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ namespace Chill\PersonBundle\Privacy;
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PrivacyEvent
|
* Class PrivacyEvent
|
||||||
@ -33,25 +33,25 @@ use Chill\PersonBundle\Entity\Person;
|
|||||||
*
|
*
|
||||||
* @package Chill\PersonBundle\Privacy
|
* @package Chill\PersonBundle\Privacy
|
||||||
*/
|
*/
|
||||||
class PrivacyEvent extends Event
|
class PrivacyEvent implements Event
|
||||||
{
|
{
|
||||||
const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event';
|
const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Person
|
* @var Person
|
||||||
*/
|
*/
|
||||||
private $person;
|
private $person;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $args;
|
private $args;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $persons;
|
private $persons;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PrivacyEvent constructor.
|
* PrivacyEvent constructor.
|
||||||
*
|
*
|
||||||
@ -64,7 +64,7 @@ class PrivacyEvent extends Event
|
|||||||
$this->args = $args;
|
$this->args = $args;
|
||||||
$this->persons = array();
|
$this->persons = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Person
|
* @return Person
|
||||||
*/
|
*/
|
||||||
@ -72,17 +72,17 @@ class PrivacyEvent extends Event
|
|||||||
{
|
{
|
||||||
return $this->person;
|
return $this->person;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Person $person
|
* @param Person $person
|
||||||
*/
|
*/
|
||||||
public function addPerson(Person $person)
|
public function addPerson(Person $person)
|
||||||
{
|
{
|
||||||
$this->persons[] = $person;
|
$this->persons[] = $person;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array $persons
|
* @return array $persons
|
||||||
*/
|
*/
|
||||||
@ -90,7 +90,7 @@ class PrivacyEvent extends Event
|
|||||||
{
|
{
|
||||||
return $this->persons;
|
return $this->persons;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
@ -98,7 +98,7 @@ class PrivacyEvent extends Event
|
|||||||
{
|
{
|
||||||
return count($this->persons) >= 1;
|
return count($this->persons) >= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -106,5 +106,5 @@ class PrivacyEvent extends Event
|
|||||||
{
|
{
|
||||||
return $this->args;
|
return $this->args;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user