/** * Add entity * * @param string $entityType * @param integer $entityId * @param string $text * @param integer $timeStamp * @param array $tags * @param string $status * @throws Exception * @return void */ public function addEntity($entityType, $entityId, $text, $timeStamp, array $tags = array(), $status = null) { $dto = new BOL_SearchEntity(); $dto->entityType = $entityType; $dto->entityId = $entityId; $dto->text = $this->cleanSearchText($text); $dto->timeStamp = $timeStamp; $dto->activated = BOL_SearchEntityDao::ENTITY_ACTIVATED; $dto->status = !$status ? BOL_SearchEntityDao::ENTITY_STATUS_ACTIVE : $status; $this->searchEntityDao->save($dto); $searchEntityId = $dto->id; // add tags if ($tags) { foreach ($tags as $tag) { $dto = new BOL_SearchEntityTag(); $dto->entityTag = $tag; $dto->searchEntityId = $searchEntityId; $this->searchEntityTagDao->save($dto); } } }