private function getFromModel(Model $itemModel, $attr, $defaultValue = null)
    {
        $variable = $itemModel;

        if (!empty($attr)) {
            foreach (explode('.', $attr) as $attr) {
                $variable = array_get($variable, $attr, $defaultValue);
            }
        }

        return $variable;
    }
private function getFromModel(Model $itemModel, $attr, $defaultValue = null)
    {
        $variable = $itemModel;

        if (!empty($attr)) {
            foreach (explode('.', $attr) as $attr) {
                $variable = array_get($variable, $attr, $defaultValue);
            }
        }

        return $variable;
    }
private function getFromModel ( Model $ itemModel , $ attr , $ defaultValue = null ) { $ variable = $ itemModel ; if ( ! empty ( $ attr ) ) { foreach ( explode ( '.' , $ attr ) as $ attr ) { $ variable = array_get ( $ variable , $ attr , $ defaultValue ) ; } } return $ variable ; }
Gets a option from the model.

@param Model $itemModel
@param $attr
@param null $defaultValue

@return Model|null
Gets a option from the model .