public function searchForSubItem($data)
    {
        $matches = [];

        foreach ($this->subItems as $subItem) {
            if ($subItem->find($data)) {
                $matches[] = $subItem;
            }
        }

        return $matches;
    }
public function searchForSubItem($data)
    {
        $matches = [];

        foreach ($this->subItems as $subItem) {
            if ($subItem->find($data)) {
                $matches[] = $subItem;
            }
        }

        return $matches;
    }
public function searchForSubItem ( $ data ) { $ matches = [ ] ; foreach ( $ this -> subItems as $ subItem ) { if ( $ subItem -> find ( $ data ) ) { $ matches [ ] = $ subItem ; } } return $ matches ; }
A way to find sub items.

@param $data

@return array
A way to find sub items .