/** * * @param Resultset $rs */ private static function _getObject(Resultset $rs) { $ret = new self(); while ($rs->NextRow()) { $ret->setSetting($rs->getKey(), $rs->getValue()); } $ret->resetSignature(); return $ret; }
private static function _getObject(Resultset $rs, Project_Build $build) { $ret = new self($build); $ret->setDate($rs->getDate()); $ret->setVersion($rs->getVersion()); $ret->setAhh($rs->getAhh()); $ret->setAndc($rs->getAndc()); $ret->setCalls($rs->getCalls()); $ret->setCcn($rs->getCcn()); $ret->setCcn2($rs->getCcn2()); $ret->setCloc($rs->getCloc()); $ret->setClsa($rs->getClsa()); $ret->setClsc($rs->getClsc()); $ret->setEloc($rs->getEloc()); $ret->setFanout($rs->getFanout()); $ret->setLeafs($rs->getLeafs()); $ret->setLloc($rs->getLloc()); $ret->setLoc($rs->getLoc()); $ret->setMaxDit($rs->getMaxDit()); $ret->setNcloc($rs->getNcloc()); $ret->setNoc($rs->getNoc()); $ret->setNof($rs->getNof()); $ret->setNoi($rs->getNoi()); $ret->setNom($rs->getNom()); $ret->setNop($rs->getNop()); $ret->setRoots($rs->getRoots()); $ret->resetSignature(); return $ret; }
private static function _getObject(Resultset $rs, Project_Build $build) { $ret = new self($build); $ret->setDate($rs->getDate()); $ret->setVersion($rs->getVersion()); $ret->resetSignature(); return $ret; }
private static function _getObject(Resultset $rs, Project $project, User $user) { if (empty($user) || !$user instanceof User || empty($project) || !$project instanceof Project) { return false; } $ret = new self($project, $user, $rs->getAccess()); // // The following is a workaround on the fact that the translation of this // serialized object to the database gets all broken, due to the fact of PHP // introducing NULL bytes around the '*' that is prepended before protected // variable members, in the serialized mode. This method replaces those // problematic NULL bytes with an identifier string '~~NULL_BYTE~~', // rendering serialization and unserialization of these specific kinds of // object safe. Credits to travis@travishegner.com on: // http://pt.php.net/manual/en/function.serialize.php#96504 // $unsafeSerializedNotifications = str_replace(CINTIENT_NULL_BYTE_TOKEN, "", $rs->getNotifications()); if (($notifications = unserialize($unsafeSerializedNotifications)) === false || !$notifications instanceof NotificationSettings) { $notifications = new NotificationSettings($project, $user); } $ret->setNotifications($notifications); $ret->resetSignature(); // Update user and project for these notification settings $notifications->setPtrProject($project); $notifications->setPtrUser($user); return $ret; }