service = $service; $this->gateway = $gateway; } /** * @param string $referenceTable * @param int $referenceId * @param string $labelType * * @throws InvalidArgumentException * @throws LabelTypeNotFoundException * @throws LabelAssignException If assignment fails * * @return int Created ID from label_reference table */ public function assignLabel($referenceTable, $referenceId, $labelType) { return $this->service->assignLabel($referenceTable, $referenceId, $labelType); } /** * @param string $referenceTable * @param int $referenceId * @param string $labelType * * @throws InvalidArgumentException * @throws LabelAssignException If assignment fails * * @return void */ public function unassignLabel($referenceTable, $referenceId, $labelType) { $this->service->unassignLabel($referenceTable, $referenceId, $labelType); } /** * @param string $referenceTable * @param int $referenceId * * @return array */ public function findLabelsByReference($referenceTable, $referenceId) { return $this->gateway->findLabelsByReference($referenceTable, $referenceId); } /** * @param string $referenceTable * @param int[]|array $referenceIds * * @return array */ public function findLabelsByReferences($referenceTable, $referenceIds) { return $this->gateway->findLabelsByReferences($referenceTable, $referenceIds); } /** * @param string $referenceTable * @param int $referenceId * * @return array */ public function findLabelTypesByReference($referenceTable, $referenceId) { return $this->gateway->findLabelTypesByReference($referenceTable, $referenceId); } }