Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. .....
  2. "require": {
  3. "php": ">=5.3.3",
  4. "symfony/symfony": "2.2.*",
  5. "doctrine/orm": "~2.2,>=2.2.3",
  6. "doctrine/doctrine-bundle": "1.2.*",
  7. "twig/extensions": "1.0.*",
  8. "symfony/assetic-bundle": "2.1.*",
  9. "symfony/swiftmailer-bundle": "2.2.*",
  10. "symfony/monolog-bundle": "2.2.*",
  11. "sensio/distribution-bundle": "2.2.*",
  12. "sensio/framework-extra-bundle": "2.2.*",
  13. "sensio/generator-bundle": "2.2.*",
  14. "jms/security-extra-bundle": "1.4.*",
  15. "jms/di-extra-bundle": "1.3.*",
  16. "friendsofsymfony/user-bundle": "*",
  17. "doctrine/doctrine-migrations-bundle": "dev-master",
  18. "stof/doctrine-extensions-bundle": "~1.1@dev"
  19. },
  20. ....
  21.  
  22. stof_doctrine_extensions:
  23. default_locale: en_US
  24. orm:
  25. default:
  26. sluggable: true
  27. sortable: true
  28.  
  29. <?php
  30.  
  31. namespace SixStringPearBundleEntity;
  32.  
  33. use GedmoMappingAnnotation as Gedmo;
  34. use DoctrineORMMapping as ORM;
  35.  
  36. /**
  37. * @ORMEntity
  38. * @ORMTable(name="icon")
  39. * @ORMHasLifecycleCallbacks()
  40. */
  41. class Icon
  42. {
  43.  
  44. ....(other properties and getters/setters)
  45.  
  46. /**
  47. * @var datetime $created
  48. *
  49. * @GedmoTimestampable(on="create")
  50. * @ORMColumn(type="datetime")
  51. */
  52. protected $created;
  53.  
  54. /**
  55. * @param datetime $created
  56. */
  57. public function setCreated($created)
  58. {
  59. $this->created = $created;
  60. }
  61.  
  62. /**
  63. * @Route("/admin/go")
  64. */
  65. public function goAction(){
  66.  
  67. $icon = new SixStringPearBundleEntityIcon();
  68. $icon->setName("shawn");
  69. $icon->setZip(12345);
  70. $icon->setType("go");
  71.  
  72. $em = $this->getDoctrine()->getManager();
  73. $em->persist($icon);
  74. $em->flush();
  75. }
  76.  
  77. An exception occurred while executing 'INSERT INTO icon (name, zip, thumb, created, updated, createdBy_id) VALUES (?, ?, ?, ?, ?, ?)' with params ["shawn", 12345, "go", null, null, null]:
  78.  
  79. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'created' cannot be null
  80.  
  81. stof_doctrine_extensions:
  82. orm:
  83. default:
  84. timestampable: true
  85.  
  86. stof_doctrine_extensions:
  87. default_locale: en
  88. translation_fallback: true
  89. orm:
  90. default:
  91. timestampable: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement