Introduced empty PartRepository for later use.

This commit is contained in:
Jan Böhmer 2019-02-23 22:52:48 +01:00
parent e9325bfb89
commit 7dbdb959b8
3 changed files with 22 additions and 4 deletions

View file

@ -6,6 +6,7 @@ namespace App\Controller;
use App\Entity\Attachment;
use App\Entity\AttachmentType;
use App\Entity\Category;
use App\Entity\Part;
use App\Entity\StructuralDBElement;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
@ -18,12 +19,12 @@ class HomepageController extends AbstractController
*/
function homepage()
{
$repo = $this->getDoctrine()->getRepository(Category::class);
$repo = $this->getDoctrine()->getRepository(Part::class);
/** @var StructuralDBElement $attachment */
$attachment = $repo->find(1);
dump($attachment, $attachment->getSubelements(false)->toArray());
dump($attachment);
$response = "";
return $this->render('base.html.twig');
}

View file

@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM;
* Class Part
* @package App\Entity
*
* @ORM\Entity()
* @ORM\Entity(repositoryClass="App\Repository\PartRepository")
* @ORM\Table("parts")
*/
class Part extends AttachmentContainingDBElement
@ -53,7 +53,7 @@ class Part extends AttachmentContainingDBElement
/**
* @var Attachment
* @ORM\ManyToOne(targetEntity="Attachment")
* @ORM\JoinColumn(name="id_master_picture_attachment", referencedColumnName="id")
* @ORM\JoinColumn(name="id_master_picture_attachement", referencedColumnName="id")
*/
protected $master_picture_attachment;

View file

@ -0,0 +1,17 @@
<?php
/**
* Created by PhpStorm.
* User: janhb
* Date: 23.02.2019
* Time: 22:46
*/
namespace App\Repository;
use Doctrine\ORM\EntityRepository;
class PartRepository extends EntityRepository
{
//TODO
}