Example #1
0
 /**
  * Retrieve inactive category item ids
  *
  * @param Collection $collection
  * @param int $storeId
  * @return array
  */
 protected function _getInactiveItemIds($collection, $storeId)
 {
     $filter = $collection->getAllIdsSql();
     $attributeId = $this->_getIsActiveAttributeId();
     $conditionSql = $this->_conn->getCheckSql('c.value_id > 0', 'c.value', 'd.value');
     $table = $this->_coreResource->getTableName('catalog_category_entity_int');
     $bind = array('attribute_id' => $attributeId, 'store_id' => $storeId, 'zero_store_id' => 0, 'cond' => 0);
     $select = $this->_conn->select()->from(array('d' => $table), array('d.entity_id'))->where('d.attribute_id = :attribute_id')->where('d.store_id = :zero_store_id')->where('d.entity_id IN (?)', new \Zend_Db_Expr($filter))->joinLeft(array('c' => $table), 'c.attribute_id = :attribute_id AND c.store_id = :store_id AND c.entity_id = d.entity_id', array())->where($conditionSql . ' = :cond');
     return $this->_conn->fetchCol($select, $bind);
 }