<?php

/**
 * This is the model class for table "{{data_xml}}".
 *
 * The followings are the available columns in table '{{data_xml}}':
 * @property integer $xml_id
 * @property integer $release_id
 * @property integer $paper_id
 * @property integer $news_id
 * @property string $xml_reportedperson
 * @property integer $xml_site
 * @property integer $xml_year
 * @property integer $xml_month
 * @property string $xml_papername
 * @property string $xml_lssue
 * @property string $xml_date
 * @property integer $xml_pagecount
 * @property string $xml_editionnumber
 * @property string $xml_thumbnailimage
 * @property string $xml_pagename
 * @property string $xml_pagepdf
 * @property integer $xml_sizewidth
 * @property integer $xml_sizeheight
 * @property string $xml_title_eyebrow
 * @property string $xml_title
 * @property string $xml_title_sub
 * @property string $xml_author
 * @property string $xml_class
 * @property string $xml_articleclass
 * @property integer $xml_imagesnumbers
 * @property string $xml_resource
 * @property string $xml_area
 * @property string $xml_foreword
 * @property string $xml_keywords
 * @property string $xml_content
 * @property string $xml_coordinate
 * @property integer $xml_wordsnumber
 * @property string $xml_personage
 * @property string $xml_subjectmatter
 * @property string $xml_product
 * @property string $xml_color
 * @property string $xml_advertisers
 * @property string $xml_size
 * @property string $xml_adervertisetype
 * @property string $xml_data_url
 */
class DataXml extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return DataXml the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return '{{data_xml}}';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('release_id, paper_id, news_id, xml_site, xml_year, xml_month, xml_pagecount, xml_sizewidth, xml_sizeheight, xml_imagesnumbers, xml_wordsnumber', 'numerical', 'integerOnly'=>true),
			array('xml_reportedperson, xml_papername, xml_coordinate, xml_personage, xml_subjectmatter, xml_color, xml_advertisers, xml_size, xml_adervertisetype', 'length', 'max'=>50),
			array('xml_lssue, xml_editionnumber, xml_author, xml_class, xml_articleclass, xml_resource, xml_area', 'length', 'max'=>100),
			array('xml_date', 'length', 'max'=>20),
			array('xml_thumbnailimage, xml_pagename, xml_pagepdf, xml_foreword, xml_keywords, xml_product, xml_data_url', 'length', 'max'=>400),
			array('xml_title_eyebrow, xml_title, xml_title_sub', 'length', 'max'=>300),
			array('xml_content', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('xml_id, release_id, paper_id, news_id, xml_reportedperson, xml_site, xml_year, xml_month, xml_papername, xml_lssue, xml_date, xml_pagecount, xml_editionnumber, xml_thumbnailimage, xml_pagename, xml_pagepdf, xml_sizewidth, xml_sizeheight, xml_title_eyebrow, xml_title, xml_title_sub, xml_author, xml_class, xml_articleclass, xml_imagesnumbers, xml_resource, xml_area, xml_foreword, xml_keywords, xml_content, xml_coordinate, xml_wordsnumber, xml_personage, xml_subjectmatter, xml_product, xml_color, xml_advertisers, xml_size, xml_adervertisetype, xml_data_url', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'xml_id' => 'Xml',
			'release_id' => 'Release',
			'paper_id' => 'Paper',
			'news_id' => 'News',
			'xml_reportedperson' => 'Xml Reportedperson',
			'xml_site' => 'Xml Site',
			'xml_year' => 'Xml Year',
			'xml_month' => 'Xml Month',
			'xml_papername' => 'Xml Papername',
			'xml_lssue' => 'Xml Lssue',
			'xml_date' => 'Xml Date',
			'xml_pagecount' => 'Xml Pagecount',
			'xml_editionnumber' => 'Xml Editionnumber',
			'xml_thumbnailimage' => 'Xml Thumbnailimage',
			'xml_pagename' => 'Xml Pagename',
			'xml_pagepdf' => 'Xml Pagepdf',
			'xml_sizewidth' => 'Xml Sizewidth',
			'xml_sizeheight' => 'Xml Sizeheight',
			'xml_title_eyebrow' => 'Xml Title Eyebrow',
			'xml_title' => 'Xml Title',
			'xml_title_sub' => 'Xml Title Sub',
			'xml_author' => 'Xml Author',
			'xml_class' => 'Xml Class',
			'xml_articleclass' => 'Xml Articleclass',
			'xml_imagesnumbers' => 'Xml Imagesnumbers',
			'xml_resource' => 'Xml Resource',
			'xml_area' => 'Xml Area',
			'xml_foreword' => 'Xml Foreword',
			'xml_keywords' => 'Xml Keywords',
			'xml_content' => 'Xml Content',
			'xml_coordinate' => 'Xml Coordinate',
			'xml_wordsnumber' => 'Xml Wordsnumber',
			'xml_personage' => 'Xml Personage',
			'xml_subjectmatter' => 'Xml Subjectmatter',
			'xml_product' => 'Xml Product',
			'xml_color' => 'Xml Color',
			'xml_advertisers' => 'Xml Advertisers',
			'xml_size' => 'Xml Size',
			'xml_adervertisetype' => 'Xml Adervertisetype',
			'xml_data_url' => 'Xml Data Url',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('xml_id',$this->xml_id);
		$criteria->compare('release_id',$this->release_id);
		$criteria->compare('paper_id',$this->paper_id);
		$criteria->compare('news_id',$this->news_id);
		$criteria->compare('xml_reportedperson',$this->xml_reportedperson,true);
		$criteria->compare('xml_site',$this->xml_site);
		$criteria->compare('xml_year',$this->xml_year);
		$criteria->compare('xml_month',$this->xml_month);
		$criteria->compare('xml_papername',$this->xml_papername,true);
		$criteria->compare('xml_lssue',$this->xml_lssue,true);
		$criteria->compare('xml_date',$this->xml_date,true);
		$criteria->compare('xml_pagecount',$this->xml_pagecount);
		$criteria->compare('xml_editionnumber',$this->xml_editionnumber,true);
		$criteria->compare('xml_thumbnailimage',$this->xml_thumbnailimage,true);
		$criteria->compare('xml_pagename',$this->xml_pagename,true);
		$criteria->compare('xml_pagepdf',$this->xml_pagepdf,true);
		$criteria->compare('xml_sizewidth',$this->xml_sizewidth);
		$criteria->compare('xml_sizeheight',$this->xml_sizeheight);
		$criteria->compare('xml_title_eyebrow',$this->xml_title_eyebrow,true);
		$criteria->compare('xml_title',$this->xml_title,true);
		$criteria->compare('xml_title_sub',$this->xml_title_sub,true);
		$criteria->compare('xml_author',$this->xml_author,true);
		$criteria->compare('xml_class',$this->xml_class,true);
		$criteria->compare('xml_articleclass',$this->xml_articleclass,true);
		$criteria->compare('xml_imagesnumbers',$this->xml_imagesnumbers);
		$criteria->compare('xml_resource',$this->xml_resource,true);
		$criteria->compare('xml_area',$this->xml_area,true);
		$criteria->compare('xml_foreword',$this->xml_foreword,true);
		$criteria->compare('xml_keywords',$this->xml_keywords,true);
		$criteria->compare('xml_content',$this->xml_content,true);
		$criteria->compare('xml_coordinate',$this->xml_coordinate,true);
		$criteria->compare('xml_wordsnumber',$this->xml_wordsnumber);
		$criteria->compare('xml_personage',$this->xml_personage,true);
		$criteria->compare('xml_subjectmatter',$this->xml_subjectmatter,true);
		$criteria->compare('xml_product',$this->xml_product,true);
		$criteria->compare('xml_color',$this->xml_color,true);
		$criteria->compare('xml_advertisers',$this->xml_advertisers,true);
		$criteria->compare('xml_size',$this->xml_size,true);
		$criteria->compare('xml_adervertisetype',$this->xml_adervertisetype,true);
		$criteria->compare('xml_data_url',$this->xml_data_url,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}