當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Post::setPublicationDate方法代碼示例

本文整理匯總了PHP中AppBundle\Entity\Post::setPublicationDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Post::setPublicationDate方法的具體用法?PHP Post::setPublicationDate怎麽用?PHP Post::setPublicationDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AppBundle\Entity\Post的用法示例。


在下文中一共展示了Post::setPublicationDate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: load

 public function load(ObjectManager $manager)
 {
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151201T12:00'));
     $p1->setPublish(true);
     $p1->setTitle('Installation de Symfony');
     $p1->setAbstract("Ce tutoriel présente l'installation du framework symfony dans sa dernière version stable. C'est une base pour commencer à développer une application web avec. Il couvre l'installation du serveur apache, mysql ainsi que le langage php et l'interface d'administration de base de donnée phpmyadmin.");
     $article = "Installer les prérequis";
     $article = $article . "\n" . "----------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "liste=\\";
     $article = $article . "\n" . "apache2 \\";
     $article = $article . "\n" . "php5 \\";
     $article = $article . "\n" . "mysql-server \\";
     $article = $article . "\n" . "libapache2-mod-php5 \\";
     $article = $article . "\n" . "php5-mysql \\";
     $article = $article . "\n" . "phpmyadmin \\";
     $article = $article . "\n" . "php5-intl\"";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "sudo apt-get install \$liste";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "sudo sed -i -e 's/;date.timezone =/date.timezone = Europe\\/Paris/g' /etc/php5/apache2/php.ini";
     $article = $article . "\n" . "sudo sed -i -e 's/;date.timezone =/date.timezone = Europe\\/Paris/g' /etc/php5/cli/php.ini";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Installer symfony et un alias";
     $article = $article . "\n" . "------------------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony";
     $article = $article . "\n" . "sudo chmod a+x /usr/local/bin/symfony";
     $article = $article . "\n" . "echo alias sy=\\\"php app/console\\\" >> \$HOME/.bashrc";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Installer composer";
     $article = $article . "\n" . "------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "curl -sS https://getcomposer.org/installer | php";
     $article = $article . "\n" . "sudo mv composer.phar /usr/local/bin/composer";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Sources :";
     $article = $article . "\n" . "---------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "1. http://symfony.com/download";
     $article = $article . "\n" . "2. http://doc.ubuntu-fr.org/composer";
     $p1->setContent($article);
     $p1->setAuthor($this->getReference('user-admin'));
     $manager->persist($p1);
     $manager->flush();
     $p1 = new Post();
     $p1->setPublicationDate(new \DateTime('20151202T12:00'));
     $p1->setPublish(true);
     $p1->setTitle('Installer et configurer un projet symfony');
     $p1->setAbstract("Comment démarrer la toute base d'un projet symfony ? Cette article répond aux questions de configuration mail pour le dev, creation du projet, mise en relation de symfony avec sublime text. Il faut aussi gérer les droits que vous donner à apache ou autre serveur ! Sinon il ne pourra pas écrire dans le dossier de cache et de logs ainsi que les fichiers que vous uploaderez !");
     $article = "Installation des fichiers";
     $article = $article . "\n" . "-------------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```bash";
     $article = $article . "\n" . "# installe la dernière version LTS";
     $article = $article . "\n" . "symfony new my_project lts";
     $article = $article . "\n" . "cd my_project";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "mkdir web/uploads";
     $article = $article . "\n" . "HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\\  -f1`";
     $article = $article . "\n" . "# ajouter les dossiers dans lesquels ils faut écrire";
     $article = $article . "\n" . "sudo setfacl -R -m u:\"\$HTTPDUSER\":rwX -m u:`whoami`:rwX app/cache app/logs web/uploads";
     $article = $article . "\n" . "sudo setfacl -dR -m u:\"\$HTTPDUSER\":rwX -m u:`whoami`:rwX app/cache app/logs web/uploads";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Configuration des fichiers";
     $article = $article . "\n" . "---------------------------";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "### parameters.yml";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "La base de donnée, c'est facile";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "Pour les mails :";
     $article = $article . "\n" . "```yml";
     $article = $article . "\n" . "parameters:";
     $article = $article . "\n" . "    mailer_transport: gmail";
     $article = $article . "\n" . "    mailer_host: ~";
     $article = $article . "\n" . "    mailer_user:  your_gmail_username";
     $article = $article . "\n" . "    mailer_password:  your_gmail_password";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "### config.yml";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "```yml";
     $article = $article . "\n" . "parameters:";
     $article = $article . "\n" . "    locale: fr|en";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "framework:";
     $article = $article . "\n" . "    ide: \"subl:///%%f:%%1\"";
     $article = $article . "\n" . "```";
     $article = $article . "\n" . "";
     $article = $article . "\n" . "**Note :** Il faut installer le paquet \"subl protocol\" dans sublime text pour avoir les liens";
     $article = $article . "\n" . "";
//.........這裏部分代碼省略.........
開發者ID:paul-mesnilgrente,項目名稱:paul-mesnilgrente,代碼行數:101,代碼來源:LoadPostData.php


注:本文中的AppBundle\Entity\Post::setPublicationDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。