Advertisement
Guest User

Untitled

a guest
Feb 20th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. class myRepository
  2. {
  3. private $conn;
  4.  
  5. public function __construct(Connection $conn){
  6. $this->conn = $conn;
  7. }
  8.  
  9. public function getStuff(){
  10. $sql = "SELECT * FROM stuff";
  11. return $this->conn->fetchAll($sql);
  12. }
  13. }
  14.  
  15. services:
  16. my_repo:
  17. class: MyBundleRepositoryMyRepository
  18. arguments: ["@doctrine.dbal.default_connection"]
  19.  
  20. doctrine:
  21. dbal:
  22. default_connection: default
  23. connections:
  24. default:
  25. driver: pdo_mysql
  26. host: "%database_host%"
  27. port: "%database_port%"
  28. dbname: "%database_name%"
  29. user: "%database_user%"
  30. password: "%database_password%"
  31. charset: UTF8
  32.  
  33. "doctrine/orm": "^2.5",
  34. "doctrine/doctrine-bundle": "^1.6",
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement