public function getItemsByOrderId($orderId)
    {
        $result = [];
        /* aliases and tables */
        $asOrder = 'sale';
        $asPvItem = 'pv';
        $tblOrder = [$asOrder => $this->resource->getTableName(Cfg::ENTITY_MAGE_SALES_ORDER_ITEM)];
        $tblPvItem = [$asPvItem => $this->resource->getTableName(Entity::ENTITY_NAME)];
        /* SELECT FROM sales_order_item */
        $query = $this->conn->select();
        $cols = [];
        $query->from($tblOrder, $cols);
        /* LEFT JOIN prxgt_pv_sale_item pwq */
        $on = $asPvItem . '.' . Entity::A_ITEM_REF . '=' . $asOrder . '.' . Cfg::E_SALE_ORDER_ITEM_A_ITEM_ID;
        $cols = '*'; // get all columns
        $query->joinLeft($tblPvItem, $on, $cols);
        /* WHERE */
        $where = $asOrder . '.' . Cfg::E_SALE_ORDER_ITEM_A_ORDER_ID . '=' . (int)$orderId;
        $query->where($where);
        /* fetch data */
        $rows = $this->conn->fetchAll($query);
        foreach ($rows as $row) {
            /** @var Entity $item */
            $item = new Entity($row);
            $result[$item->getItemRef()] = $item;
        }
        return $result;
    }
public function getItemsByOrderId($orderId)
    {
        $result = [];
        /* aliases and tables */
        $asOrder = 'sale';
        $asPvItem = 'pv';
        $tblOrder = [$asOrder => $this->resource->getTableName(Cfg::ENTITY_MAGE_SALES_ORDER_ITEM)];
        $tblPvItem = [$asPvItem => $this->resource->getTableName(Entity::ENTITY_NAME)];
        /* SELECT FROM sales_order_item */
        $query = $this->conn->select();
        $cols = [];
        $query->from($tblOrder, $cols);
        /* LEFT JOIN prxgt_pv_sale_item pwq */
        $on = $asPvItem . '.' . Entity::A_ITEM_REF . '=' . $asOrder . '.' . Cfg::E_SALE_ORDER_ITEM_A_ITEM_ID;
        $cols = '*'; // get all columns
        $query->joinLeft($tblPvItem, $on, $cols);
        /* WHERE */
        $where = $asOrder . '.' . Cfg::E_SALE_ORDER_ITEM_A_ORDER_ID . '=' . (int)$orderId;
        $query->where($where);
        /* fetch data */
        $rows = $this->conn->fetchAll($query);
        foreach ($rows as $row) {
            /** @var Entity $item */
            $item = new Entity($row);
            $result[$item->getItemRef()] = $item;
        }
        return $result;
    }
public function getItemsByOrderId ( $ orderId ) { $ result = [ ] ; /* aliases and tables */ $ asOrder = 'sale' ; $ asPvItem = 'pv' ; $ tblOrder = [ $ asOrder => $ this -> resource -> getTableName ( Cfg :: ENTITY_MAGE_SALES_ORDER_ITEM ) ] ; $ tblPvItem = [ $ asPvItem => $ this -> resource -> getTableName ( Entity :: ENTITY_NAME ) ] ; /* SELECT FROM sales_order_item */ $ query = $ this -> conn -> select ( ) ; $ cols = [ ] ; $ query -> from ( $ tblOrder , $ cols ) ; /* LEFT JOIN prxgt_pv_sale_item pwq */ $ on = $ asPvItem . '.' . Entity :: A_ITEM_REF . '=' . $ asOrder . '.' . Cfg :: E_SALE_ORDER_ITEM_A_ITEM_ID ; $ cols = '*' ; // get all columns $ query -> joinLeft ( $ tblPvItem , $ on , $ cols ) ; /* WHERE */ $ where = $ asOrder . '.' . Cfg :: E_SALE_ORDER_ITEM_A_ORDER_ID . '=' . ( int ) $ orderId ; $ query -> where ( $ where ) ; /* fetch data */ $ rows = $ this -> conn -> fetchAll ( $ query ) ; foreach ( $ rows as $ row ) { /** @var Entity $item */ $ item = new Entity ( $ row ) ; $ result [ $ item -> getItemRef ( ) ] = $ item ; } return $ result ; }
Get array of the PvSaleItems entities by Magento order ID.
@param int $orderId
@return Entity[] index is a $saleItemId
Get array of the PvSaleItems entities by Magento order ID .