<?php
App::uses('AppModel', 'Model');
/**
 * PeerPoint Model
 *
 */
class PeerPoint extends AppModel {
/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'name';

/**
 * Criando peer_points em massa
 * @param unknown_type $from ex. 6000
 * @param unknown_type $to   ex. 6050
 * @param unknown_type $type ex. khomp
 */	
	public function bulk_create($from, $to, $type) {
		
		while ($from <= $to) {
			$PeerPoint = ClassRegistry::init('PeerPoint');
			$PeerPoint->create();
			$PeerPoint->set('name', $from);
			$PeerPoint->set('alias', $from);
			$PeerPoint->set('type', $type);
			$PeerPoint = $PeerPoint->save();
			$from++;
		}
	}
}
