services/NorthWind/NorthWindQueryProvider.php
/**
     * Serialize the sql row into Order object
     * 
     * @param array $record each row of customer
     * 
     * @return object
     */
Serialize the sql row into Order object

@param array $record each row of customer

@return object
Serialize the sql row into Order object @param array $record each row of customer @return object
private function _serializeOrder($record)
    {
        $order = new Order();
        $order->OrderID = $record['OrderID'];
        $order->CustomerID = $record['CustomerID'];
        $order->EmployeeID = $record['EmployeeID'];
        $order->OrderDate = !is_null($record['OrderDate']) ? $record['OrderDate']->format('Y-m-d\TH:i:s'): null;
        $order->RequiredDate = !is_null($record['RequiredDate']) ? $record['RequiredDate']->format('Y-m-d\TH:i:s'): null;
        $order->ShippedDate = !is_null($record['ShippedDate']) ? $record['ShippedDate']->format('Y-m-d\TH:i:s'): null;
        $order->ShipVia = $record['ShipVia'];
        $order->Freight = $record['Freight'];
        $order->ShipName = $record['ShipName'];
        $order->ShipAddress = $record['ShipAddress'];
        $order->ShipCity = $record['ShipCity'];
        $order->ShipRegion = $record['ShipRegion'];
        $order->ShipPostalCode = $record['ShipPostalCode'];
        $order->ShipCountry = $record['ShipCountry'];
        return $order;
    }
private function _serializeOrder ( $ record ) { $ order = new Order ( ) ; $ order -> OrderID = $ record [ 'OrderID' ] ; $ order -> CustomerID = $ record [ 'CustomerID' ] ; $ order -> EmployeeID = $ record [ 'EmployeeID' ] ; $ order -> OrderDate = ! is_null ( $ record [ 'OrderDate' ] ) ? $ record [ 'OrderDate' ] -> format ( 'Y-m-d\TH:i:s' ) : null ; $ order -> RequiredDate = ! is_null ( $ record [ 'RequiredDate' ] ) ? $ record [ 'RequiredDate' ] -> format ( 'Y-m-d\TH:i:s' ) : null ; $ order -> ShippedDate = ! is_null ( $ record [ 'ShippedDate' ] ) ? $ record [ 'ShippedDate' ] -> format ( 'Y-m-d\TH:i:s' ) : null ; $ order -> ShipVia = $ record [ 'ShipVia' ] ; $ order -> Freight = $ record [ 'Freight' ] ; $ order -> ShipName = $ record [ 'ShipName' ] ; $ order -> ShipAddress = $ record [ 'ShipAddress' ] ; $ order -> ShipCity = $ record [ 'ShipCity' ] ; $ order -> ShipRegion = $ record [ 'ShipRegion' ] ; $ order -> ShipPostalCode = $ record [ 'ShipPostalCode' ] ; $ order -> ShipCountry = $ record [ 'ShipCountry' ] ; return $ order ; }
Serialize the sql row into Order object
Serialize the sql row into Order object