mirror of
https://github.com/brmlab/brmsklad.git
synced 2025-08-01 22:13:34 +02:00
20 lines
514 B
PHP
20 lines
514 B
PHP
<?php
|
|
|
|
class ItemsController extends AppController {
|
|
|
|
public $scaffold;
|
|
public $paginate = array(
|
|
'limit' => 1000,
|
|
'maxLimit' => 1000
|
|
);
|
|
|
|
public function json_all(){
|
|
die(json_encode($this->Item->find('all')));
|
|
}
|
|
|
|
public function json_find($id = null){
|
|
if($id == null || !is_numeric($id)) die(json_encode(array("error"=>true)));
|
|
else die(json_encode($this->Item->find('all',array('conditions'=>array('barcode ='=>$id)))));
|
|
}
|
|
|
|
}
|