public static function getBySlug($slug)
    {
        $slug_parts = explode("-", $slug, 2);
        $class = get_called_class();
        $temp_this = new $class();
        $primary_key = $temp_this->getIDField();
        return self::search()->where($primary_key, $slug_parts[0])->execOne();
    }
public static function getBySlug($slug)
    {
        $slug_parts = explode("-", $slug, 2);
        $class = get_called_class();
        $temp_this = new $class();
        $primary_key = $temp_this->getIDField();
        return self::search()->where($primary_key, $slug_parts[0])->execOne();
    }
public static function getBySlug ( $ slug ) { $ slug_parts = explode ( "-" , $ slug , 2 ) ; $ class = get_called_class ( ) ; $ temp_this = new $ class ( ) ; $ primary_key = $ temp_this -> getIDField ( ) ; return self :: search ( ) -> where ( $ primary_key , $ slug_parts [ 0 ] ) -> execOne ( ) ; }
Pull a database record by the slug we're given.

@param $slug string Slug

@return mixed
Pull a database record by the slug we re given .