Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. $Curso = ClassRegistry::init('Curso');
  3. $Curso->recursive = 3;
  4. $cursos = $Curso->find('all', array(
  5. 'conditions' => array(
  6. 'Curso.promocao' => 1,
  7. ),
  8. 'order' => array(
  9. 'Curso.id' => 'DESC',
  10. ),
  11. 'limit' => 6,
  12. ));
  13. $banner = $cursos[3]['Escola']['foto'];
  14. if ($banner == NULL) {
  15. $banner = $cursos[3]['Escola']['Localidade']['foto'];
  16. if ($banner == NULL) {
  17. $banner = $cursos[3]['Escola']['Localidade']['LocalidadePai']['foto'];
  18. }
  19. }
  20. echo $banner;
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement