src/Common/Model/Base.php
public function getByIdOrSlug($mIdSlug, array $aData = [])
    {
        if (is_numeric($mIdSlug)) {
            return $this->getById($mIdSlug, $aData);
        } else {
            return $this->getBySlug($mIdSlug, $aData);
        }
    }
public function getByIdOrSlug($mIdSlug, array $aData = [])
    {
        if (is_numeric($mIdSlug)) {
            return $this->getById($mIdSlug, $aData);
        } else {
            return $this->getBySlug($mIdSlug, $aData);
        }
    }
public function getByIdOrSlug ( $ mIdSlug , array $ aData = [ ] ) { if ( is_numeric ( $ mIdSlug ) ) { return $ this -> getById ( $ mIdSlug , $ aData ) ; } else { return $ this -> getBySlug ( $ mIdSlug , $ aData ) ; } }
Fetch an object by it's id or slug

Auto-detects whether to use the ID or slug as the selector when fetching
an object. Note that this method uses is_numeric() to determine whether
an ID or a slug has been passed, thus numeric slugs (which are against
Nails style guidelines) will be interpreted incorrectly.

@param mixed $mIdSlug The ID or slug of the object to fetch
@param array $aData   Any data to pass to getCountCommon()

@return \stdClass
Fetch an object by it s id or slug