mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Introduced empty PartRepository for later use.
This commit is contained in:
parent
e9325bfb89
commit
7dbdb959b8
3 changed files with 22 additions and 4 deletions
|
@ -6,6 +6,7 @@ namespace App\Controller;
|
||||||
use App\Entity\Attachment;
|
use App\Entity\Attachment;
|
||||||
use App\Entity\AttachmentType;
|
use App\Entity\AttachmentType;
|
||||||
use App\Entity\Category;
|
use App\Entity\Category;
|
||||||
|
use App\Entity\Part;
|
||||||
use App\Entity\StructuralDBElement;
|
use App\Entity\StructuralDBElement;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
@ -18,12 +19,12 @@ class HomepageController extends AbstractController
|
||||||
*/
|
*/
|
||||||
function homepage()
|
function homepage()
|
||||||
{
|
{
|
||||||
$repo = $this->getDoctrine()->getRepository(Category::class);
|
$repo = $this->getDoctrine()->getRepository(Part::class);
|
||||||
|
|
||||||
/** @var StructuralDBElement $attachment */
|
/** @var StructuralDBElement $attachment */
|
||||||
$attachment = $repo->find(1);
|
$attachment = $repo->find(1);
|
||||||
|
|
||||||
dump($attachment, $attachment->getSubelements(false)->toArray());
|
dump($attachment);
|
||||||
$response = "";
|
$response = "";
|
||||||
return $this->render('base.html.twig');
|
return $this->render('base.html.twig');
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||||
* Class Part
|
* Class Part
|
||||||
* @package App\Entity
|
* @package App\Entity
|
||||||
*
|
*
|
||||||
* @ORM\Entity()
|
* @ORM\Entity(repositoryClass="App\Repository\PartRepository")
|
||||||
* @ORM\Table("parts")
|
* @ORM\Table("parts")
|
||||||
*/
|
*/
|
||||||
class Part extends AttachmentContainingDBElement
|
class Part extends AttachmentContainingDBElement
|
||||||
|
@ -53,7 +53,7 @@ class Part extends AttachmentContainingDBElement
|
||||||
/**
|
/**
|
||||||
* @var Attachment
|
* @var Attachment
|
||||||
* @ORM\ManyToOne(targetEntity="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;
|
protected $master_picture_attachment;
|
||||||
|
|
||||||
|
|
17
src/Repository/PartRepository.php
Normal file
17
src/Repository/PartRepository.php
Normal 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
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue