api/model/order.model.php
/** ----------------------------------------------
     *  OBJECT SERIALIZATION TO JSON OR DATABASE ARRAY
     *  ----------------------------------------------
     */
OBJECT SERIALIZATION TO JSON OR DATABASE ARRAY
OBJECT SERIALIZATION TO JSON OR DATABASE ARRAY
public function serialize_object($type=SERIALIZE_DATABASE)
    {
        $_properties = get_object_vars($this);
        foreach($_properties as $column=>$v)
        {
            if($this->$column !== null && !is_array($this->$column))
            {
                $data[self::TABLE_PREFIX . $column] = $this->$column;
            }
        }
        switch($type)
        {
            case SERIALIZE_JSON:
                return json_encode($data);
                break;
            case SERIALIZE_DATABASE:
            default:
                return $data;
                break;
        }
    }
public function serialize_object ( $ type = SERIALIZE_DATABASE ) { $ _properties = get_object_vars ( $ this ) ; foreach ( $ _properties as $ column => $ v ) { if ( $ this -> $ column !== null && ! is_array ( $ this -> $ column ) ) { $ data [ self :: TABLE_PREFIX . $ column ] = $ this -> $ column ; } } switch ( $ type ) { case SERIALIZE_JSON : return json_encode ( $ data ) ; break ; case SERIALIZE_DATABASE : default : return $ data ; break ; } }
OBJECT SERIALIZATION TO JSON OR DATABASE ARRAY
OBJECT SERIALIZATION TO JSON OR DATABASE ARRAY