public function getContentTypeFromAlias($alias, $forceSlug = false)
    {
        foreach ($this->contenttypes->getData() as $key => $contenttype) {
            if ($forceSlug && $forceSlug === 'singular') {
                if (isset($contenttype['singular_slug']) && ($contenttype['slug'] === $alias || $contenttype['tablename'] === $alias)) {
                    return $contenttype['singular_slug'];
                }
            } elseif ($forceSlug) {
                if (isset($contenttype['slug']) && ($contenttype['slug'] === $alias || $contenttype['tablename'] === $alias)) {
                    return $contenttype['slug'];
                }
            }
            if (isset($contenttype['tablename']) && $contenttype['tablename'] === $alias) {
                return $key;
            }

            if (isset($contenttype['slug']) && $contenttype['slug'] === $alias) {
                return $key;
            }
        }

        return $alias;
    }
public function getContentTypeFromAlias($alias, $forceSlug = false)
    {
        foreach ($this->contenttypes->getData() as $key => $contenttype) {
            if ($forceSlug && $forceSlug === 'singular') {
                if (isset($contenttype['singular_slug']) && ($contenttype['slug'] === $alias || $contenttype['tablename'] === $alias)) {
                    return $contenttype['singular_slug'];
                }
            } elseif ($forceSlug) {
                if (isset($contenttype['slug']) && ($contenttype['slug'] === $alias || $contenttype['tablename'] === $alias)) {
                    return $contenttype['slug'];
                }
            }
            if (isset($contenttype['tablename']) && $contenttype['tablename'] === $alias) {
                return $key;
            }

            if (isset($contenttype['slug']) && $contenttype['slug'] === $alias) {
                return $key;
            }
        }

        return $alias;
    }
public function getContentTypeFromAlias ( $ alias , $ forceSlug = false ) { foreach ( $ this -> contenttypes -> getData ( ) as $ key => $ contenttype ) { if ( $ forceSlug && $ forceSlug === 'singular' ) { if ( isset ( $ contenttype [ 'singular_slug' ] ) && ( $ contenttype [ 'slug' ] === $ alias || $ contenttype [ 'tablename' ] === $ alias ) ) { return $ contenttype [ 'singular_slug' ] ; } } elseif ( $ forceSlug ) { if ( isset ( $ contenttype [ 'slug' ] ) && ( $ contenttype [ 'slug' ] === $ alias || $ contenttype [ 'tablename' ] === $ alias ) ) { return $ contenttype [ 'slug' ] ; } } if ( isset ( $ contenttype [ 'tablename' ] ) && $ contenttype [ 'tablename' ] === $ alias ) { return $ key ; } if ( isset ( $ contenttype [ 'slug' ] ) && $ contenttype [ 'slug' ] === $ alias ) { return $ key ; } } return $ alias ; }
Given a tablename or slug get the correct Bolt keyname from the config.

@param $alias
@param bool $forceSlug

@return string $key
Given a tablename or slug get the correct Bolt keyname from the config .