/** * Generate the Select object for this listing. Will include the columns * from the listing's Table, any foreign key references, and also allow all * field providers to augment the Select as needed. * * @return Select */ private function generateSelect() { $select = $this->table->select(); $this->selectFromTable($select); $this->selectForeignKeyValues($select); $this->selectFieldProviderValues($select); return $select; }
/** * Load the list of available attributes from the database, if they haven't * been loaded already. The array of attributes will use the attribute field * name (e.g. "eav_1") for a key. * * @return array */ private function loadAttributes() { if (!$this->attributes) { $stmt = $this->table->select(); $stmt->from($this->getAttributeTableName()); if (is_callable($this->attributeFilterCallback)) { $stmt = call_user_func($this->attributeFilterCallback, $stmt); } $out = array(); $rs = $this->table->getAdapter()->fetchAll($stmt); foreach ($rs as $row) { if ($this->deletedIndex && isset($row[$this->deletedIndex]) && $row[$this->deletedIndex]) { continue; } $name = 'eav_' . $row['attribute_id']; $out[$name] = $row; } $this->attributes = $out; } return $this->attributes; }