demo_content.php 658 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. exit;
  3. require_once __DIR__.'/../../main/inc/global.inc.php';
  4. $em = Database::getManager();
  5. $insertUserInfo = api_get_user_entity(api_get_user_id());
  6. $userInfo = api_get_user_entity(16);
  7. $title = uniqid('title', true);
  8. $post = new \Chamilo\PluginBundle\Entity\StudentFollowUp\CarePost();
  9. $post
  10. ->setTitle($title)
  11. ->setContent($title)
  12. ->setExternalCareId(2)
  13. ->setCreatedAt(new DateTime())
  14. ->setUpdatedAt(new DateTime())
  15. ->setPrivate(false)
  16. ->setInsertUser($insertUserInfo)
  17. ->setExternalSource(0)
  18. //->setParent($parent)
  19. ->setTags(['php', 'react'])
  20. ->setUser($userInfo)
  21. ;
  22. $em->persist($post);
  23. $em->flush();