static function inicialitza($id, $idU, $idS) { $OM = self::retrieveByPK($id); if ($OM instanceof Missatges) { return new MissatgesForm($OM); } else { $OM = new Missatges(); $OM->setUsuarisUsuariid($idU); $OM->setDate(date('Y-m-d', time())); $OM->setSiteId($idS); return new MissatgesForm($OM); } }