/** * Set entities status by tags * * @param array $tags * @param string $status * @return void */ public function setEntitiesStatusByTags(array $tags, $status) { $enityTags = BOL_SearchEntityTagDao::getInstance(); $params = array(':deleted_status' => self::ENTITY_STATUS_DELETED, ':status' => $status); $query = ' UPDATE ' . $enityTags->getTableName() . ' AS a INNER JOIN ' . $this->getTableName() . ' AS b ON a.' . BOL_SearchEntityTagDao::ENTITY_SEARCH_ID . ' = b.id AND b.' . self::STATUS . ' <> :deleted_status SET b.' . self::STATUS . ' = :status WHERE a.' . BOL_SearchEntityTagDao::ENTITY_TAG . ' IN (' . $this->dbo->mergeInClause($tags) . ')'; $this->dbo->query($query, $params); }
/** * Class constructor */ public function __construct() { $this->searchEntityDao = BOL_SearchEntityDao::getInstance(); $this->searchEntityTagDao = BOL_SearchEntityTagDao::getInstance(); }