public function enableForAllStoreViews() { /* delete all store views data except admin */ $entity = Cfg::ENTITY_MAGE_CATALOG_CATEGORY_EAV_INT; $where = Cfg::E_CATCAT_EAV_INT_STORE_ID . '>' . self::DEF_STORE_VIEW_ID_ADMIN; $this->repoGeneric->deleteEntity($entity, $where); /* enable all categories */ $bind = [Cfg::E_CATCAT_EAV_INT_VALUE => 1]; $where = Cfg::E_CATCAT_EAV_INT_ATTR_ID . '=' . self::DEF_CATEGORY_EAV_ID_IS_ACTIVE; $this->repoGeneric->updateEntity($entity, $bind, $where); }
/** * Update calculated Team Volumes in compressed data table. * * @param $data * @param $calcId */ public function saveValueTv($data, $calcId) { foreach ($data as $custId => $tv) { $whereByCalcId = PtcCompress::ATTR_CALC_ID . '=' . $calcId; $whereByCustId = PtcCompress::ATTR_CUSTOMER_ID . '=' . $custId; $this->_repoBasic->updateEntity(PtcCompress::ENTITY_NAME, [PtcCompress::ATTR_TV => $tv], "{$whereByCalcId} AND {$whereByCustId}"); } }
/** @inheritdoc */ public function updateById($id, $data) { if (is_array($id)) { /* probably this is complex PK */ $where = ''; foreach ($id as $key => $value) { $val = is_int($value) ? $value : $this->_conn->quote($value); $where .= "({$key}={$val}) AND "; } $where .= '1'; // WHERE ... AND 1; } else { $val = is_int($id) ? $id : $this->_conn->quote($id); $where = $this->_idFieldName . '=' . $val; } $result = $this->_repoGeneric->updateEntity($this->_entityName, $data, $where); return $result; }