Advertisement
enkuso

qzBannerPlugin - components.class.php

May 13th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2. /**
  3.  * qzBanner Component
  4.  *
  5.  * @author Enkuso
  6.  */
  7. class qzBannerComponents extends sfComponents{
  8.     public function executeBanner(){
  9.         if($this->location){
  10.             $this->banner = Doctrine_Core::getTable('qzBanner')
  11.                     ->createQuery('b')
  12.                     ->leftJoin('b.qzBannerLocation l')
  13.                     ->where('l.location = ?', $this->location)
  14.                     ->orderBy('b.created_at DESC')
  15.                     ->limit(1)
  16.                     ->fetchOne();
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement