public static function find(ActiveRecord $owner, $condition = 0)
    {
        $seo = new self();
        $seo->_owner = $owner;
        $condition = (int)$condition;
        $data = $owner->getIsNewRecord() ? false : (new Query())
            ->from(Seo::tableName($owner))
            ->limit(1)
            ->andWhere([
                'condition' => $condition,
                'model_id' => $owner->getPrimaryKey(),
            ])->one($owner->getDb());
        $seo->_isNewRecord = empty($data);
        if ($data) {
            $seo->setAttributes($data);
        }
        $seo->condition = $condition;
        return $seo;
    }
public static function find(ActiveRecord $owner, $condition = 0)
    {
        $seo = new self();
        $seo->_owner = $owner;
        $condition = (int)$condition;
        $data = $owner->getIsNewRecord() ? false : (new Query())
            ->from(Seo::tableName($owner))
            ->limit(1)
            ->andWhere([
                'condition' => $condition,
                'model_id' => $owner->getPrimaryKey(),
            ])->one($owner->getDb());
        $seo->_isNewRecord = empty($data);
        if ($data) {
            $seo->setAttributes($data);
        }
        $seo->condition = $condition;
        return $seo;
    }
public static function find ( ActiveRecord $ owner , $ condition = 0 ) { $ seo = new self ( ) ; $ seo -> _owner = $ owner ; $ condition = ( int ) $ condition ; $ data = $ owner -> getIsNewRecord ( ) ? false : ( new Query ( ) ) -> from ( Seo :: tableName ( $ owner ) ) -> limit ( 1 ) -> andWhere ( [ 'condition' => $ condition , 'model_id' => $ owner -> getPrimaryKey ( ) , ] ) -> one ( $ owner -> getDb ( ) ) ; $ seo -> _isNewRecord = empty ( $ data ) ; if ( $ data ) { $ seo -> setAttributes ( $ data ) ; } $ seo -> condition = $ condition ; return $ seo ; }
Search SEO data. If not found, will be returned new SEO model with empty data
@param ActiveRecord $owner the ActiveRecord model for which to find data
@param int $condition optional condition for searched SEO data
@return self
Search SEO data . If not found will be returned new SEO model with empty data