cerebrate/src/Model/Entity/Organisation.php

34 lines
805 B
PHP

<?php
namespace App\Model\Entity;
use App\Model\Entity\AppModel;
use Cake\ORM\Entity;
class Organisation extends AppModel
{
protected $_accessible = [
'*' => true,
'id' => false,
'created' => false
];
protected $_accessibleOnNew = [
'created' => true
];
public function rearrangeForAPI(array $options = []): void
{
if (!empty($this->tags)) {
$this->tags = $this->rearrangeTags($this->tags);
}
if (!empty($this->alignments)) {
$this->alignments = $this->rearrangeAlignments($this->alignments);
}
if (!empty($this->meta_fields) || !empty($this->MetaTemplates)) {
$this->rearrangeMetaFields($options);
}
}
// MetaTemplate object property is not unset!!
}