<?php
class InventoryArticle extends AppModel {
	var $name = 'InventoryArticles';
	var $displayField = 'formated_display';
	//var $order = array('InventoryArticle.name ASC');
	var $virtualFields = array(
    //'formated_display' => "CONCAT(IFNULL(Article.barcode,''),' ',Article.display)"
);
	var $validate = array(
	
		
		'article_code' => array(
			'numeric' => array(
				'rule' => array('numeric'),
			),
		),
		
	);

	/*var $belongsTo = array(
		
		)
	);*/

	/*var $hasMany = array(
		
	);*/

	/*function  _formatDisplayField($row) {
		return "{$row['Article']['name']} ({$row['Article']['unit']})";
	}*/
	
	/*public function afterFind($results, $primary = false) {
    foreach ($results as $key => $val) {
         {
     if (  $results[$key]['Article']['barcode'] !=null)    $results[$key]['Article']['display'] = $results[$key]['Article']['barcode']." ".$results[$key]['Article']['display'];
        }
    }
    return $results;
}*/

}
