public static function verify($categoryId = null, $id = null, $slug = null, $guest = true)
    {
        if (!is_numeric($categoryId) || $categoryId < 1 || !is_numeric($id) || $id < 1 || empty($slug)) {
            return null;
        }
        return static::find()->joinWith(['category' => function ($query) use ($guest) {
                if ($guest) {
                    $query->andWhere([Category::tableName() . '.visible' => 1]);
                }
            }])->where([
                static::tableName() . '.id' => $id,
                static::tableName() . '.slug' => $slug,
                static::tableName() . '.category_id' => $categoryId,
            ])->limit(1)->one();
    }
public static function verify($categoryId = null, $id = null, $slug = null, $guest = true)
    {
        if (!is_numeric($categoryId) || $categoryId < 1 || !is_numeric($id) || $id < 1 || empty($slug)) {
            return null;
        }
        return static::find()->joinWith(['category' => function ($query) use ($guest) {
                if ($guest) {
                    $query->andWhere([Category::tableName() . '.visible' => 1]);
                }
            }])->where([
                static::tableName() . '.id' => $id,
                static::tableName() . '.slug' => $slug,
                static::tableName() . '.category_id' => $categoryId,
            ])->limit(1)->one();
    }
public static function verify ( $ categoryId = null , $ id = null , $ slug = null , $ guest = true ) { if ( ! is_numeric ( $ categoryId ) || $ categoryId < 1 || ! is_numeric ( $ id ) || $ id < 1 || empty ( $ slug ) ) { return null ; } return static :: find ( ) -> joinWith ( [ 'category' => function ( $ query ) use ( $ guest ) { if ( $ guest ) { $ query -> andWhere ( [ Category :: tableName ( ) . '.visible' => 1 ] ) ; } } ] ) -> where ( [ static :: tableName ( ) . '.id' => $ id , static :: tableName ( ) . '.slug' => $ slug , static :: tableName ( ) . '.category_id' => $ categoryId , ] ) -> limit ( 1 ) -> one ( ) ; }
Returns the verified forum.
@param int $categoryId forum category ID
@param int $id forum ID
@param string $slug forum slug
@param bool $guest whether caller is guest or registered user
@return Forum
@since 0.2
Returns the verified forum .