public function setId($id)
    {
        if (is_null($this->id) && ! is_null($id) && ($model = $this->getRepository()->find($id))) {
            $this->id = $id;

            parent::setModel($model);
            $this->getButtons()->setModel($model);
            $this->setModelClass(get_class($model));
        }
    }
public function setId($id)
    {
        if (is_null($this->id) && ! is_null($id) && ($model = $this->getRepository()->find($id))) {
            $this->id = $id;

            parent::setModel($model);
            $this->getButtons()->setModel($model);
            $this->setModelClass(get_class($model));
        }
    }
public function setId ( $ id ) { if ( is_null ( $ this -> id ) && ! is_null ( $ id ) && ( $ model = $ this -> getRepository ( ) -> find ( $ id ) ) ) { $ this -> id = $ id ; parent :: setModel ( $ model ) ; $ this -> getButtons ( ) -> setModel ( $ model ) ; $ this -> setModelClass ( get_class ( $ model ) ) ; } }
Set currently loaded model id.

@param int $id
Set currently loaded model id .