public function getStuff($brand){    $web=FALSE;        if($this->getWebcorners()):            foreach ($this->getWebcorners() as $webcorner):                if(strtolower($webcorner->getBrand()->getName())== $brand):                    return $webcorner;                endif;                if($webcorner->getBrandId()==NULL):                    $web=$webcorner;                endif;            endforeach;        endif;    return $web;}the function is suppose to list a collection of webcorners and return the first that matches a brand, then the one that is null (in this order).  There's a possibility to have many other webcorners according to the brand (but no matching the one that is passed by parameter to the function).
List a collection of webcorners
php
Just cleaned up your method a little: (Guard condition, better variable name, less nesting)public function getStuff($brand){    if(!$this->getWebcorners()) return false;    $fallback=false;    foreach ($this->getWebcorners() as $webcorner) {        if(strtolower($webcorner->getBrand()->getName())== $brand) return $webcorner;        if($webcorner->getBrandId()==NULL) $fallback=$webcorner;    }    return $fallback;}If you want to return the first item without a brand you have to add the $fallback==false condition to your second if. Otherwise you use the last suitable item.