当前位置: 首页>>代码示例>>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;未经允许,请勿转载。