Permalink
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?
match/app/src/Lib/Traits/AssociationTrait.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
132 lines (110 sloc)
3.47 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
} |