本文整理汇总了PHP中DateTimeHelper::dateTimeToFormatedString方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeHelper::dateTimeToFormatedString方法的具体用法?PHP DateTimeHelper::dateTimeToFormatedString怎么用?PHP DateTimeHelper::dateTimeToFormatedString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeHelper
的用法示例。
在下文中一共展示了DateTimeHelper::dateTimeToFormatedString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
global $request;
$em = \Shared\DoctrineHelper::getEntityManager();
$idCompte = $request->request->get("idCompte");
$idDiscussion = $request->request->get("idDiscussion");
$message = $request->request->get("message");
$objSupportMessage = new \Site\Entity\SupportMessages();
$objSupportMessage->setIdCompte($idCompte);
$objSupportMessage->setIdDiscussion($idDiscussion);
$objSupportMessage->setMessage($message);
$objSupportMessage->setDate(new \DateTime(date("Y-m-d H:i:s")));
$objSupportMessage->setEtat(\SupportEtatMessageHelper::NON_LU);
$objSupportMessage->setDatechangementEtat(new \DateTime(date("Y-m-d H:i:s")));
$objSupportMessage->setIp($this->ipAdresse);
try {
$objSupportDiscussion = \Site\SiteHelper::getSupportDiscussionsRepository()->find($idDiscussion);
$objSupportDiscussion->setDateDernierMessage(new \DateTime(date("Y-m-d H:i:s")));
$em->persist($objSupportDiscussion);
$em->persist($objSupportMessage);
$em->flush();
if ($idCompte == $objSupportDiscussion->getIdAdmin()) {
$objAccountJoueur = \Account\AccountHelper::getAccountRepository()->find($objSupportDiscussion->getIdCompte());
if ($objAccountJoueur !== null) {
$template = $this->objTwig->loadTemplate("MessagerieMessageAdd.html5.twig");
$result = $template->render(["compte" => $objAccountJoueur->getLogin(), "objet" => \SupportObjetsHelper::getLibelle($objSupportDiscussion->getIdObjet())]);
$subject = 'VamosMT2 - Réponse à votre ticket';
\EmailHelper::sendEmail($objAccountJoueur->getEmail(), $subject, $result);
}
}
echo json_encode(["id" => $objSupportMessage->getId(), "date" => \DateTimeHelper::dateTimeToFormatedString($objSupportMessage->getDate(), "H:i"), "message" => nl2br($objSupportMessage->getMessage())]);
} catch (Exception $ex) {
}
}
示例2: run
public function run()
{
$columnsParameters = array(array('dbField' => 'SupportDiscussionsEntity.idObjet', 'dtField' => 'objet', 'formatter' => function ($d, $row) {
return \SupportObjetsHelper::getLibelle($d);
}), array('dbField' => 'AdminsEntity.name', 'dtField' => 'compte', 'formatter' => function ($d, $row) {
if ($this->isAdmin) {
return $row["user"];
} else {
return $d;
}
}), array('dbField' => 'AccountEntityUser.login', 'dtField' => 'user'), array('dbField' => 'SupportDiscussionsEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d, "d/m/Y");
}), array('dbField' => 'SupportDiscussionsEntity.dateDernierMessage', 'dtField' => 'lastMessage', 'formatter' => function ($d, $row) {
$firstDate = date("Y-m-d");
$secondDate = $d->format('Y-m-d');
if ($firstDate == $secondDate) {
return \DateTimeHelper::dateTimeToFormatedString($d, "H:i:s");
} else {
return \DateTimeHelper::dateTimeToFormatedString($d);
}
}), array('dbField' => 'SupportMessagesEntity.id', 'dtField' => 'nonLuInDiscussion', 'formatter' => function ($d, $row) {
if ($d === null) {
return "";
} else {
return "lineGreen";
}
}), array('dbField' => 'SupportDiscussionsEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
$varButton = '<a class="btn btn-material btn-primary btn-sm" onclick="DiscussionOpen(\'' . \Encryption::encrypt($d) . '\')"><i class="material-icons md-icon-message"></i></a>';
$varButton .= '<a class="btn btn-material btn-warning btn-sm" onclick="DiscussionArchivage(\'' . \Encryption::encrypt($d) . '\', 1)"><i class="material-icons md-icon-archive"></i></a>';
return '<div class="btn-toolbar">' . $varButton . "</div>";
}));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\SupportDiscussions", "SupportDiscussionsEntity")->innerJoin("\\Site\\Entity\\Admins", "AdminsEntity", "WITH", "AdminsEntity.idCompte = SupportDiscussionsEntity.idAdmin")->leftJoin("\\Account\\Entity\\Account", "AccountEntityUser", "WITH", "AccountEntityUser.id = SupportDiscussionsEntity.idCompte")->leftJoin("\\Site\\Entity\\SupportMessages", "SupportMessagesEntity", "WITH", "SupportMessagesEntity.idDiscussion = SupportDiscussionsEntity.id AND SupportMessagesEntity.etat = " . \SupportEtatMessageHelper::NON_LU . " AND SupportMessagesEntity.idCompte != " . $this->objAccount->getId() . "")->andWhere("SupportDiscussionsEntity.idCompte = " . $this->objAccount->getId() . " OR SupportDiscussionsEntity.idAdmin = " . $this->objAccount->getId() . "")->andWhere("SupportDiscussionsEntity.estArchive = 0")->groupBy("SupportDiscussionsEntity.id");
$datatable->getResult()->toJson();
}
示例3: run
public function run()
{
$columnsParameters = array(array('dbField' => 'LogsItemshopAchatsEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d);
}), array('dbField' => 'LogsItemshopAchatsEntity.item', 'dtField' => 'article'), array('dbField' => 'LogsItemshopAchatsEntity.quantite', 'filterLevel' => 'strict', 'dtField' => 'quantite'), array('dbField' => 'LogsItemshopAchatsEntity.devise', 'dtField' => 'devise'), array('dbField' => 'LogsItemshopAchatsEntity.prix', 'filterLevel' => 'strict', 'dtField' => 'prix', 'formatter' => function ($d, $row) {
return number_format($d, 0, '.', ',') . "<span style='position:relative; top:2px;'>" . \FonctionsUtiles::findIconDevise($row["devise"]) . "</span>";
}), array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'LogsItemshopAchatsEntity.resultat', 'dtField' => 'result'));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\LogsItemshopAchats", "LogsItemshopAchatsEntity")->leftJoin("\\Account\\Entity\\Account", "AccountEntity", "WITH", "AccountEntity.id = LogsItemshopAchatsEntity.idCompte");
$datatable->getResult()->toJson();
}
示例4: run
public function run()
{
$columnsParameters = array(array('dbField' => 'ActualitesEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d);
}), array('dbField' => 'ActualitesEntity.titre', 'dtField' => 'titre'), array('dbField' => 'ActualitesEntity.contenu', 'dtField' => 'message', 'formatter' => function ($d, $row) {
return \FonctionsUtiles::Raccourcissement_Chaine($d, 50);
}), array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'ActualitesEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
$varButton = '<a class="btn btn-material btn-primary btn-sm" data-featherlight="ajax" href="pages/Admin/GererNewsEdit.php?mode=mod&idNews=' . $d . '"><i class="material-icons md-icon-edit"></i></a>';
$varButton .= '<a class="btn btn-material btn-danger btn-sm" onclick="SuppressionNews(' . $d . ')"><i class="material-icons md-icon-delete"></i></a>';
return '<div class="btn-toolbar">' . $varButton . "</div>";
}));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\Actualites", "ActualitesEntity")->leftJoin("\\Account\\Entity\\Account", "AccountEntity", "WITH", "AccountEntity.id = ActualitesEntity.idCompte");
$datatable->getResult()->toJson();
}
示例5: run
public function run()
{
$columnsParameters = array(array('dbField' => 'SupportDiscussionsEntity.idObjet', 'dtField' => 'objet', 'formatter' => function ($d, $row) {
return \SupportObjetsHelper::getLibelle($d);
}), array('dbField' => 'AdminsEntity.name', 'dtField' => 'compte', 'formatter' => function ($d, $row) {
if ($this->isAdmin) {
return $row["user"];
} else {
return $d;
}
}), array('dbField' => 'AccountEntityUser.login', 'dtField' => 'user'), array('dbField' => 'SupportDiscussionsEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d, "d/m/Y");
}), array('dbField' => 'SupportDiscussionsEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
$varButton = '<a class="btn btn-material btn-primary btn-sm" onclick="DiscussionOpen(\'' . \Encryption::encrypt($d) . '\')"><i class="material-icons md-icon-search"></i></a>';
return '<div class="btn-toolbar">' . $varButton . "</div>";
}));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\SupportDiscussions", "SupportDiscussionsEntity")->innerJoin("\\Site\\Entity\\Admins", "AdminsEntity", "WITH", "AdminsEntity.idCompte = SupportDiscussionsEntity.idAdmin")->leftJoin("\\Account\\Entity\\Account", "AccountEntityUser", "WITH", "AccountEntityUser.id = SupportDiscussionsEntity.idCompte")->andWhere("SupportDiscussionsEntity.idCompte = " . $this->objAccount->getId() . " OR SupportDiscussionsEntity.idAdmin = " . $this->objAccount->getId() . "")->andWhere("SupportDiscussionsEntity.estArchive = 1");
$datatable->getResult()->toJson();
}
示例6: run
public function run()
{
$columnsParameters = array(array('dbField' => 'PlayerEntity.name', 'dtField' => 'name', 'formatter' => function ($d, $row) {
return \FonctionsUtiles::findIconJob($row["job"]) . " " . $d;
}), array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'PlayerEntity.job', 'dtField' => 'job'), array('dbField' => 'GmlistEntity.mauthority', 'dtField' => 'authority', 'formatter' => function ($d, $row) {
return \AuthorityHelper::getLibelle($d);
}), array('dbField' => 'PlayerEntity.playtime', 'dtField' => 'playtime', 'formatter' => function ($d, $row) {
return \DateTimeHelper::minutesToString($d);
}), array('dbField' => 'PlayerEntity.lastPlay', 'dtField' => 'lastPlay', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d);
}), array('dbField' => 'AccountEntity.status', 'filterLevel' => 'strict', 'dtField' => 'status', 'formatter' => function ($d, $row) {
return \FonctionsUtiles::findIconStatus($d);
}), array('dbField' => 'PlayerEntity.ip', 'dtField' => 'ip'), array('dbField' => 'GmlistEntity.mid', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
$varButton = '<a class="btn btn-material btn-primary btn-sm" data-featherlight="ajax" href="pages/Admin/modules/GererEquipeJeu/GererEquipeJeuEdit.php?mode=mod&idMembre=' . $d . '"><i class="material-icons md-icon-edit"></i></a>';
$varButton .= '<a class="btn btn-material btn-danger btn-sm " onclick="SuppressionMembreEquipe(' . $d . ')"><i class="material-icons md-icon-delete"></i></a>';
return '<div class="btn-toolbar">' . $varButton . "</div>";
}));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Common\\Entity\\Gmlist", "GmlistEntity")->innerJoin("\\Player\\Entity\\Player", "PlayerEntity", "WITH", "PlayerEntity.name = GmlistEntity.mname")->innerJoin("\\Account\\Entity\\Account", "AccountEntity", "WITH", "AccountEntity.login = GmlistEntity.maccount");
$datatable->getResult()->toJson();
}
示例7: run
public function run()
{
$columnsParameters = array(array('dbField' => 'LogsAdminGererMonnaieEntity.idCompte', 'dtField' => 'idCompte'), array('dbField' => 'AccountEntityUser.login', 'dtField' => 'recepteur', 'formatter' => function ($d, $row) {
if ($row["idCompte"] == 0) {
return "Tout le monde";
} else {
return $d;
}
}), array('dbField' => 'LogsAdminGererMonnaieEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d);
}), array('dbField' => 'AccountEntityAdmin.login', 'dtField' => 'emetteur'), array('dbField' => 'LogsAdminGererMonnaieEntity.operation', 'filterLevel' => 'strict', 'dtField' => 'operation', 'formatter' => function ($d, $row) {
if ($d == 1) {
return "a donné";
} else {
return "a enlevé";
}
}), array('dbField' => 'LogsAdminGererMonnaieEntity.montant', 'filterLevel' => 'strict', 'dtField' => 'montant'), array('dbField' => 'LogsAdminGererMonnaieEntity.devise', 'filterLevel' => 'strict', 'dtField' => 'devise', 'formatter' => function ($d, $row) {
return \DeviseHelper::getLibelle($d);
}));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\LogsAdminGererMonnaie", "LogsAdminGererMonnaieEntity")->leftJoin("\\Account\\Entity\\Account", "AccountEntityUser", "WITH", "AccountEntityUser.id = LogsAdminGererMonnaieEntity.idCompte")->innerJoin("\\Account\\Entity\\Account", "AccountEntityAdmin", "WITH", "AccountEntityAdmin.id = LogsAdminGererMonnaieEntity.idGm");
$datatable->getResult()->toJson();
}
示例8: run
public function run()
{
$columnsParameters = array(array('dbField' => 'GuildEntity1.name', 'filterLevel' => 'strict', 'dtField' => 'firstGuild', 'formatter' => function ($d, $row) {
return \FonctionsUtiles::findIconEmpire($row["firstEmpire"]) . " " . $d;
}), array('dbField' => 'GuildEntity2.name', 'filterLevel' => 'strict', 'dtField' => 'secondGuild', 'formatter' => function ($d, $row) {
return \FonctionsUtiles::findIconEmpire($row["secondEmpire"]) . " " . $d;
}), array('dbField' => 'PlayerMaster1Entity.name', 'dtField' => 'firstChef'), array('dbField' => 'GuildWarReservationEntity.time', 'dbConcatSeparator' => ", ", 'dtField' => 'date', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d);
}), array('dbField' => 'PlayerMaster2Entity.name', 'dtField' => 'secondChef'), array('dbField' => 'GuildWarReservationEntity.result1', 'dtField' => 'result1'), array('dbField' => 'GuildWarReservationEntity.result2', 'dtField' => 'result2'), array('dbField' => 'GuildEntityWin.name', 'filterLevel' => 'strict', 'dtField' => 'winner', 'formatter' => function ($d, $row) {
if ($row["result1"] > $row["result2"]) {
return $d . " (<span class='text-green'>" . $row["result1"] . "</span> / <span class='text-red'>" . $row["result2"] . "</span>)";
} else {
if ($row["result1"] < $row["result2"]) {
return $d . " (<span class='text-green'>" . $row["result2"] . "</span> / <span class='text-red'>" . $row["result1"] . "</span>)";
} else {
return "Match nul";
}
}
}), array('dbField' => 'PlayerIndexMaster1Entity.empire', 'dtField' => 'firstEmpire'), array('dbField' => 'PlayerIndexMaster2Entity.empire', 'dtField' => 'secondEmpire'));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Player\\Entity\\GuildWarReservation", "GuildWarReservationEntity")->leftJoin("\\Player\\Entity\\Guild", "GuildEntity1", "WITH", "GuildEntity1.id = GuildWarReservationEntity.guild1")->leftJoin("\\Player\\Entity\\Guild", "GuildEntity2", "WITH", "GuildEntity2.id = GuildWarReservationEntity.guild2")->leftJoin("\\Player\\Entity\\Guild", "GuildEntityWin", "WITH", "GuildEntityWin.id = GuildWarReservationEntity.winner")->innerJoin("\\Player\\Entity\\Player", "PlayerMaster1Entity", "WITH", "PlayerMaster1Entity.id = GuildEntity1.master")->innerJoin("\\Player\\Entity\\Player", "PlayerMaster2Entity", "WITH", "PlayerMaster2Entity.id = GuildEntity2.master")->leftJoin("\\Account\\Entity\\Account", "AccountMaster1Entity", "WITH", "AccountMaster1Entity.id = PlayerMaster1Entity.idAccount")->leftJoin("\\Account\\Entity\\Account", "AccountMaster2Entity", "WITH", "AccountMaster2Entity.id = PlayerMaster2Entity.idAccount")->leftJoin("\\Player\\Entity\\PlayerIndex", "PlayerIndexMaster1Entity", "WITH", "PlayerIndexMaster1Entity.id = AccountMaster1Entity.id")->leftJoin("\\Player\\Entity\\PlayerIndex", "PlayerIndexMaster2Entity", "WITH", "PlayerIndexMaster2Entity.id = AccountMaster2Entity.id");
$datatable->getResult()->toJson();
}
示例9: getFormatedDateTime
public function getFormatedDateTime($dateTime, $format = null)
{
return \DateTimeHelper::dateTimeToFormatedString($dateTime, $format);
}