PHP breadcrumb class I am fresh at OOP and I am curious if the code below is object oriented and can be improved:

class cTitleBreadcrumb {

public function __construct($sAction, $sItem){
    $this-&gt;sAction = $sAction;
    $this-&gt;sItem = $sItem;
}

public function displayAction(){
    if($this-&gt;checkUrlAction($this-&gt;sAction) === true){     
        return $this-&gt;sAction;
    }
}
public function displayItem(){
    if($this-&gt;checkUrlItem($this-&gt;sItem) === true){
        return $this-&gt;sItem;
    }
}       
private function checkUrlAction($sAction){

    if($sAction == 'insert' || $sAction == 'view' || $sAction == 'update' || $sAction == 'delete'){         
        return true;
    }
}

private function checkUrlItem($sItem){
    if($sItem == 'imagelist' || $sItem == 'mkdir' || $sItem == 'rdir'){
        return true;
    }
    else{       
        $objShowPDO = new mShowPDO();
        $result = $objShowPDO-&gt;allTables();     
        while($array = $result-&gt;fetch()){
            if($array[0] == $this-&gt;sItem){
                return true;
            }
        }       
    }
}



$objTitleBreadcrumb = new cTitleBreadcrumb($sAction,$sItem);

echo ucfirst($objTitleBreadcrumb-&gt;displayAction());

echo ucfirst($objTitleBreadcrumb-&gt;displayItem());
You are not always returning anything

private function checkUrlAction($sAction) {
    if(true){         
        return true;
    }

    //but else?
}


Dependency injection

$objShowPDO = new mShowPDO(); is bad a mShowPDO instance should by injected via method or constructor argument see dependency injection topics

private function checkUrlItem(mShowPDO $objShowPDO, $sItem){
    if($sItem == 'imagelist' || $sItem == 'mkdir' || $sItem == 'rdir'){
        return true;
    }

    //redundand else removed

    $result = $objShowPDO-&gt;allTables(); //maybe you can inject only the result
    while($array = $result-&gt;fetch()){
        if($array[0] == $this-&gt;sItem){
            return true;
        }
    }

    return false;
}


Hard coding

The checklists are really hard coded (long if with OR relations), try use some container for them (an array and use in_array() for example).