mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
privacyEvent: remove element parameter
This commit is contained in:
@@ -25,6 +25,14 @@ namespace Chill\PersonBundle\Privacy;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
|
||||
/**
|
||||
* Class PrivacyEvent
|
||||
*
|
||||
* Array $args expects arguments with the following keys: 'element_class', 'element_id', 'action'
|
||||
* By default, action is set to 'show'
|
||||
*
|
||||
* @package Chill\PersonBundle\Privacy
|
||||
*/
|
||||
class PrivacyEvent extends Event
|
||||
{
|
||||
const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event';
|
||||
@@ -34,11 +42,6 @@ class PrivacyEvent extends Event
|
||||
*/
|
||||
private $person;
|
||||
|
||||
/**
|
||||
* @var Object
|
||||
*/
|
||||
private $element;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@@ -53,13 +56,11 @@ class PrivacyEvent extends Event
|
||||
* PrivacyEvent constructor.
|
||||
*
|
||||
* @param Person $person
|
||||
* @param object $element
|
||||
* @param array $args
|
||||
*/
|
||||
public function __construct(Person $person, object $element = null, array $args = array('action' => 'show'))
|
||||
public function __construct(Person $person, array $args = array('action' => 'show'))
|
||||
{
|
||||
$this->person = $person;
|
||||
$this->element = $element;
|
||||
$this->args = $args;
|
||||
$this->persons = array();
|
||||
}
|
||||
@@ -95,15 +96,7 @@ class PrivacyEvent extends Event
|
||||
*/
|
||||
public function hasPersons()
|
||||
{
|
||||
return (count($this->persons) >= 1 ? true : false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Object
|
||||
*/
|
||||
public function getElement()
|
||||
{
|
||||
return $this->element;
|
||||
return count($this->persons) >= 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user