apiKey = $apiKey; $this->fieldToJoin = $fieldToJoin; } protected function getSpec(): Specification { return $this->apiKey === null || $this->apiKey->isAdmin() ? Spec::andX() : Spec::andX( Spec::join($this->fieldToJoin, 's'), $this->apiKey->spec(false, $this->fieldToJoin), ); } }