Advertisement
Guest User

Untitled

a guest
Sep 8th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. WRONG?
  2.  
  3. function __construct($name, $title = null, $source = array(), $value = '', $form = null, $emptyString = true) {
  4. parent::__construct($name, $title, $source, $value, $form, $emptyString);
  5.  
  6. $blogs = DB::query("SELECT ID, Title FROM SiteTree WHERE ID IN(SELECT DISTINCT ParentID FROM SiteTree WHERE ClassName='BlogEntry')")->map();
  7. $this->setSource($blogs);
  8. }
  9.  
  10. ----------------
  11.  
  12. RIGHT?
  13.  
  14. function __construct($name, $title = null, $source = array(), $value = '', $form = null, $emptyString = null) {
  15.  
  16. if($emptyString) $this->setHasEmptyDefault(true);
  17. if(is_string($emptyString)) $this->setEmptyString($emptyString);
  18.  
  19. parent::__construct($name, $title, $source, $value, $form, $emptyString);
  20.  
  21. $blogs = DB::query("SELECT ID, Title FROM SiteTree WHERE ID IN(SELECT DISTINCT ParentID FROM SiteTree WHERE ClassName='BlogEntry')")->map();
  22. $this->setSource($blogs);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement