<?php

class Biz_user extends CActiveRecord {

    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    public function tableName() {
        return 'biz_user';
    }

    public function rules() {
        return array(
            array('text', 'length', 'max' => 240, 'min' => 3),
            array('text', 'required'),
        );
    }

    public function attributeLabels() {
        return array(
            'text' => 'текст',
        );
    }

    public static function ownedmeornot($id) {
        $b = self::model()->findByAttributes(array('user_id' => Yii::app()->user->id, 'biz_id' => $id));
        if (!$b) {
            return false;
        } else {
            return true;
        }
    }

}
