<?php

/**
 * BasketOrder
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
class BasketOrder extends BaseBasketOrder
{
    public function getOffers()
    {
        $offers = array();
        $basket = Doctrine::getTable("Basket")->findOneByBasketOrderId($this->getId());
        if($basket){
            $offers = Doctrine_Query::create()
                ->select("bo.*, o.*, t.*")
                ->from("BasketOffer bo")
                ->innerJoin("bo.Offer o")
                ->innerJoin("o.Translation t WITH t.lang = 'ru'")
                ->where("bo.basket_id = ?", $basket->getId())
                ->fetchArray();
        }
        return $offers;
    }
}
