Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Latest commit cceb359 Sep 1, 2021 History
0 contributors

Users who have contributed to this file

132 lines (110 sloc) 3.47 KB
<?php
/**
* COmanage Match Association Trait
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @package match
* @since COmanage Match v1.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
declare(strict_types = 1);
namespace App\Lib\Traits;
trait AssociationTrait {
// Array of associated models to copy during a duplicate
private $duplicateContains = false;
// Array of associated models to pull during an edit
private $editContains = false;
// Array of associated models to save during a patch
private $patchAssociated = [];
// Array of associated models to pull during a view
private $viewContains = false;
/**
* Obtain the set of associated models to copy during a duplicate.
*
* @since COmanage Match v1.0.0
* @return array Array of associated models
*/
public function getDuplicateContains() {
return $this->duplicateContains;
}
/**
* Obtain the set of associated models to pull during an edit.
*
* @since COmanage Match v1.0.0
* @return array Array of associated models
*/
public function getEditContains() {
return $this->editContains;
}
/**
* Obtain the set of associated models to save during a patch.
*
* @since COmanage Match v1.0.0
* @return array Array of associated models
*/
public function getPatchAssociated() {
return $this->patchAssociated;
}
/**
* Obtain the set of associated models to pull during a view.
*
* @since COmanage Match v1.0.0
* @return array Array of associated models
*/
public function getViewContains() {
return $this->viewContains;
}
/**
* Set the associated models to copy during a duplicate.
*
* @since COmanage Match v1.0.0
* @param array $c Array of associated models
*/
public function setDuplicateContains(array $c) {
$this->duplicateContains = $c;
}
/**
* Set the associated models to pull during an edit.
*
* @since COmanage Match v1.0.0
* @param array $c Array of associated models
*/
public function setEditContains(array $c) {
$this->editContains = $c;
}
/**
* Set the associated models to save during a patch.
*
* @since COmanage Match v1.0.0
* @param array $a Array of associated models
*/
public function setPatchAssociated(array $a) {
$this->patchAssociated = $a;
}
/**
* Set the associated models to pull during a view.
*
* @since COmanage Match v1.0.0
* @param array $c Array of associated models
*/
public function setViewContains(array $c) {
$this->viewContains = $c;
}
}