public function ContentHubEntityDependency::setRelationship in Acquia Content Hub 8
Sets the relationship flag.
Parameters
int $type: The Relationship type.
Return value
\Drupal\acquia_contenthub\ContentHubEntityDependency This object.
Throws
\Exception
1 call to ContentHubEntityDependency::setRelationship()
- ContentHubEntityDependency::__construct in src/
ContentHubEntityDependency.php - Public constructor.
File
- src/
ContentHubEntityDependency.php, line 160
Class
- ContentHubEntityDependency
- Content Hub Dependency Class.
Namespace
Drupal\acquia_contenthubCode
public function setRelationship($type = self::RELATIONSHIP_INDEPENDENT) {
switch ($type) {
case self::RELATIONSHIP_INDEPENDENT:
case self::RELATIONSHIP_DEPENDENT:
$this->dependencyType = $type;
break;
default:
throw new \Exception("Unknown relationship: {$type}.");
}
return $this;
}