Added event type missing attributes
Change-Id: I5116a5c342f71603b147648a41ad5291eb4fe6d8 Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
parent
1c1c05b8ed
commit
7f3cc9e17f
@ -55,6 +55,8 @@ final class EventTypeValidationRulesFactory
|
||||
'use_sponsors' => 'sometimes|boolean',
|
||||
'are_sponsors_mandatory' => 'sometimes|boolean|required_with:use_sponsors',
|
||||
'allows_attachment' => 'sometimes|boolean',
|
||||
'is_private' => 'sometimes|boolean',
|
||||
'is_default' => 'sometimes|boolean',
|
||||
];
|
||||
|
||||
$specific_rules = [];
|
||||
|
@ -74,6 +74,12 @@ class SummitEventType extends SilverstripeBaseModel
|
||||
*/
|
||||
protected $is_default;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="IsPrivate", type="boolean")
|
||||
* @var bool
|
||||
*/
|
||||
protected $is_private;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="SummitDocument", mappedBy="event_types")
|
||||
*/
|
||||
@ -173,12 +179,6 @@ class SummitEventType extends SilverstripeBaseModel
|
||||
|
||||
const ClassName = 'EVENT_TYPE';
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="IsPrivate", type="boolean")
|
||||
* @var bool
|
||||
*/
|
||||
protected $is_private;
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
@ -197,6 +197,10 @@ class SummitEventType extends SilverstripeBaseModel
|
||||
$this->is_default = false;
|
||||
}
|
||||
|
||||
public function setIsDefault(bool $is_default){
|
||||
$this->is_default = $is_default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $use_sponsors
|
||||
*/
|
||||
|
@ -117,6 +117,12 @@ final class SummitEventTypeFactory
|
||||
if(isset($data['allows_attachment']))
|
||||
$event_type->setAllowsAttachment(boolval($data['allows_attachment']));
|
||||
|
||||
if(isset($data['is_private']))
|
||||
$event_type->setIsPrivate(boolval($data['is_private']));
|
||||
|
||||
if(isset($data['is_default']))
|
||||
$event_type->setIsDefault(boolval($data['is_default']));
|
||||
|
||||
$summit->addEventType($event_type);
|
||||
return $event_type;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user