protected function getGroupByRoleName(string $name) : ?EntityInterface
    {
        $result = TableRegistry::get('Groups.Groups')->find()
            ->enableHydration(true)
            ->where(['name' => $name])
            ->first();

        Assert::nullOrIsInstanceOf($result, EntityInterface::class);

        return $result;
    }
protected function getGroupByRoleName(string $name) : ?EntityInterface
    {
        $result = TableRegistry::get('Groups.Groups')->find()
            ->enableHydration(true)
            ->where(['name' => $name])
            ->first();

        Assert::nullOrIsInstanceOf($result, EntityInterface::class);

        return $result;
    }
protected function getGroupByRoleName ( string $ name ) : ? EntityInterface { $ result = TableRegistry :: get ( 'Groups.Groups' ) -> find ( ) -> enableHydration ( true ) -> where ( [ 'name' => $ name ] ) -> first ( ) ; Assert :: nullOrIsInstanceOf ( $ result , EntityInterface :: class ) ; return $ result ; }
Fetch group entity based on role name

@param  string $name Role name
@return \Cake\Datasource\EntityInterface|null
Fetch group entity based on role name