static function inicialitza($id, $idMG, $idS) { $OM = self::retrieveByPK($id); if (!$OM instanceof Material) { $OM = new Material(); $OM->setMaterialgenericIdmaterialgeneric($idMG); $OM->setUnitats(1); $OM->setSiteId($idS); $OM->setActiu(true); } return new MaterialForm($OM, array('IDS' => $idS)); }