You are here

public function ContentHubEntityDependency::__construct in Acquia Content Hub 8

Public constructor.

Parameters

\Acquia\ContentHubClient\Entity $cdf: The Entity CDF.

Throws

\Exception

File

src/ContentHubEntityDependency.php, line 64

Class

ContentHubEntityDependency
Content Hub Dependency Class.

Namespace

Drupal\acquia_contenthub

Code

public function __construct(Entity $cdf) {
  $this->cdf = $cdf;
  if (in_array($this->cdf
    ->getType(), self::getPostDependencyEntityTypes())) {
    $this
      ->setRelationship(self::RELATIONSHIP_DEPENDENT);
  }
  else {
    $this
      ->setRelationship(self::RELATIONSHIP_INDEPENDENT);
  }
}