Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace app\controllers;
- use App\Entities\Student;
- use Doctrine\ORM\Tools\Setup;
- use Doctrine\ORM\EntityManager;
- use Doctrine\ORM\EntityManagerInterface;
- use Doctrine\ORM\EntityRepository;
- class MainController extends AppController {
- public function index(){
- // echo 'Hello test';
- }
- public function new(){
- $name = 'Ura';
- $surname = 'Greachka';
- $entityManager = new EntityManager;
- $entityManager->getRepository('StudentRepository');
- $student = new Student();
- $student->setName($name);
- $student->setSurname($surname);
- $entityManager->persist($student);
- $entityManager->flush();
- }
- public function remove(){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement