public function getItems(array $conditions = array())
    {
        $list = $this->getList($conditions);

        if (empty($list)) {
            return array();
        }

        $handler_id = null;

        $items = array();
        foreach ((array) $list as $item) {
            $handler_id = $item['type'];
            $items[$item['entity_id']] = $item;
        }

        $handlers = $this->collection->getHandlers();

        $entity_conditions = array(
            'status' => isset($conditions['status']) ? $conditions['status'] : null,
            $handlers[$handler_id]['entity'] . '_id' => array_keys($items)
        );

        $entities = $this->getListEntities($handler_id, $entity_conditions);

        if (empty($entities)) {
            return array();
        }

        foreach ($entities as $entity_id => &$entity) {
            if (isset($items[$entity_id])) {
                $entity['weight'] = $items[$entity_id]['weight'];
                $entity['collection_item'] = $items[$entity_id];
                $entity['collection_handler'] = $handlers[$handler_id];
            }
        }

        gplcart_array_sort($entities);
        return $entities;
    }
public function getItems(array $conditions = array())
    {
        $list = $this->getList($conditions);

        if (empty($list)) {
            return array();
        }

        $handler_id = null;

        $items = array();
        foreach ((array) $list as $item) {
            $handler_id = $item['type'];
            $items[$item['entity_id']] = $item;
        }

        $handlers = $this->collection->getHandlers();

        $entity_conditions = array(
            'status' => isset($conditions['status']) ? $conditions['status'] : null,
            $handlers[$handler_id]['entity'] . '_id' => array_keys($items)
        );

        $entities = $this->getListEntities($handler_id, $entity_conditions);

        if (empty($entities)) {
            return array();
        }

        foreach ($entities as $entity_id => &$entity) {
            if (isset($items[$entity_id])) {
                $entity['weight'] = $items[$entity_id]['weight'];
                $entity['collection_item'] = $items[$entity_id];
                $entity['collection_handler'] = $handlers[$handler_id];
            }
        }

        gplcart_array_sort($entities);
        return $entities;
    }
public function getItems ( array $ conditions = array ( ) ) { $ list = $ this -> getList ( $ conditions ) ; if ( empty ( $ list ) ) { return array ( ) ; } $ handler_id = null ; $ items = array ( ) ; foreach ( ( array ) $ list as $ item ) { $ handler_id = $ item [ 'type' ] ; $ items [ $ item [ 'entity_id' ] ] = $ item ; } $ handlers = $ this -> collection -> getHandlers ( ) ; $ entity_conditions = array ( 'status' => isset ( $ conditions [ 'status' ] ) ? $ conditions [ 'status' ] : null , $ handlers [ $ handler_id ] [ 'entity' ] . '_id' => array_keys ( $ items ) ) ; $ entities = $ this -> getListEntities ( $ handler_id , $ entity_conditions ) ; if ( empty ( $ entities ) ) { return array ( ) ; } foreach ( $ entities as $ entity_id => & $ entity ) { if ( isset ( $ items [ $ entity_id ] ) ) { $ entity [ 'weight' ] = $ items [ $ entity_id ] [ 'weight' ] ; $ entity [ 'collection_item' ] = $ items [ $ entity_id ] ; $ entity [ 'collection_handler' ] = $ handlers [ $ handler_id ] ; } } gplcart_array_sort ( $ entities ) ; return $ entities ; }
Returns an array of collection item entities
@param array $conditions
@return array
Returns an array of collection item entities