SMMP/build/generic/view/machine/view/motheure.php

36 lines
770 B
PHP

<?php
namespace view\machine\view;
use \generic\core\i_patch;
use \api\core\Request;
use \error\core\Err;
class motheure extends i_patch{
/* (1) Attributes
---------------------------------------------------------*/
public $patch = [
'card_motheure_patch' => 'motheure_count.twig'
];
public function get_motheure($id_machine){
/* (1) Get its machine_clusters
---------------------------------------------------------*/
/* (1) Create request */
$motheureReq = new Request('motheure/getCount', ['id_machine' => $id_machine]);
/* (2) Execute */
$motheureRes = $motheureReq->dispatch();
/* (3) Manage error */
if( $motheureRes->error->get() != Err::Success )
return null;
return $motheureRes->get('count');
}
}