<?php
App::uses('AppController', 'Controller');
/**
 * PhoneOperators Controller
 *
 * @property PhoneOperator $PhoneOperator
 */
class PhoneOperatorsController extends AppController {

	/**
	 * beforeFilter
	 *
	 * @return void
	 */
	public function beforeFilter() {
		parent::beforeFilter();
		$this->Auth->allow(
				'index'
		);
	}

/**
 * admin_index method
 *
 * @return void
 */
	public function index() {
		
		$this->FilterResults->addFilters(
				array(
						'filter_name' => array(
								'PhoneOperator.name' => array(
										'operator' => 'LIKE',
										'value' => array(
												'before' => '%',
												'after' => '%'
										)
								)
						),
						'filter_code' => array(
								'PhoneOperator.code' => array(
										'operator' => 'LIKE',
										'value' => array(
												'before' => '%',
												'after' => '%'
										)
								)
						),
				)
		);
		
		// Define conditions		
		$this->FilterResults->setPaginate('conditions', $this->FilterResults->getConditions());
		$this->FilterResults->setPaginate('limit', 10);		
		
		$this->PhoneOperator->recursive = 0;		
		$this->set('phoneOperators', $this->paginate());
	}
	
}
