public function getList(array $options)
    {
        $result = null;
        $this->hook->attach('product.related.list.before', $options, $result, $this);

        if (isset($result)) {
            return $result;
        }

        $result = array();

        if (isset($options['product_id'])) {

            $sql = 'SELECT item_product_id FROM product_related WHERE product_id=?';

            if (!empty($options['limit'])) {
                $sql .= ' LIMIT ' . implode(',', array_map('intval', $options['limit']));
            }

            $result = $this->db->fetchColumnAll($sql, array($options['product_id']));
        }

        $this->hook->attach('product.related.list.after', $options, $result, $this);
        return $result;
    }
public function getList(array $options)
    {
        $result = null;
        $this->hook->attach('product.related.list.before', $options, $result, $this);

        if (isset($result)) {
            return $result;
        }

        $result = array();

        if (isset($options['product_id'])) {

            $sql = 'SELECT item_product_id FROM product_related WHERE product_id=?';

            if (!empty($options['limit'])) {
                $sql .= ' LIMIT ' . implode(',', array_map('intval', $options['limit']));
            }

            $result = $this->db->fetchColumnAll($sql, array($options['product_id']));
        }

        $this->hook->attach('product.related.list.after', $options, $result, $this);
        return $result;
    }
public function getList ( array $ options ) { $ result = null ; $ this -> hook -> attach ( 'product.related.list.before' , $ options , $ result , $ this ) ; if ( isset ( $ result ) ) { return $ result ; } $ result = array ( ) ; if ( isset ( $ options [ 'product_id' ] ) ) { $ sql = 'SELECT item_product_id FROM product_related WHERE product_id=?' ; if ( ! empty ( $ options [ 'limit' ] ) ) { $ sql .= ' LIMIT ' . implode ( ',' , array_map ( 'intval' , $ options [ 'limit' ] ) ) ; } $ result = $ this -> db -> fetchColumnAll ( $ sql , array ( $ options [ 'product_id' ] ) ) ; } $ this -> hook -> attach ( 'product.related.list.after' , $ options , $ result , $ this ) ; return $ result ; }
Returns an array of related products for the given product ID
@param array $options
@return array
Returns an array of related products for the given product ID