public static function checkConsumptionForEnergyMeter($act, $em_id_or_sl_id, $co_id, array $opt = array()) { $opt = array_merge(array('method' => '', 'skip_methods' => array(), 'kind' => null), $opt); if (!in_array($opt['method'], $opt['skip_methods'])) { if ($act == 'add') { if ($opt['kind'] == 'street_lighting') { R3Security::checkStreetLighting($em_id_or_sl_id); } else { R3Security::checkEnergyMeter($em_id_or_sl_id); } } else { // Can edit/delete the given id R3Security::checkConsumption($co_id); } } }