<?php

class Clothes extends CActiveRecord {

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

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

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

    public function attributeLabels() {
        return array(

        );
    }

    public static function findClothes($id) {
        $clothes = self::model()->findByPk($id);
        if (!$clothes) {
            throw new CHttpException(404, 'Предмета не существует');
        } else {
            return $clothes;
        }
    }

}
