Wanted Card + Fixs
This commit is contained in:
@@ -29,7 +29,7 @@ class HomeController extends AbstractController
|
||||
->order(['createdAt' => 'DESC'])
|
||||
->getResult(),
|
||||
'wanted' =>
|
||||
$DirectoryRepository->list()->notDead()->wanted()->getResult(),
|
||||
$DirectoryRepository->list()->notDead()->wanted()->wantedDisplay()->getResult(),
|
||||
'controller_name' => 'HomeController',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -415,6 +415,11 @@ class Directory
|
||||
*/
|
||||
private $wantedReason;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default":"1"})
|
||||
*/
|
||||
private $wantedDisplay = true;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Infringement::class, mappedBy="directory", orphanRemoval=true)
|
||||
* @ORM\OrderBy({"createdAt" = "DESC"})
|
||||
@@ -1335,6 +1340,18 @@ class Directory
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWantedDisplay(): ?bool
|
||||
{
|
||||
return $this->wantedDisplay;
|
||||
}
|
||||
|
||||
public function setWantedDisplay(bool $wantedDisplay): self
|
||||
{
|
||||
$this->wantedDisplay = $wantedDisplay;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Infringement[]
|
||||
*/
|
||||
|
||||
@@ -67,6 +67,7 @@ class DirectoryType extends AbstractType
|
||||
->add('gangInfo', null, ['label' => 'form_label_gang_info'])
|
||||
->add('wanted', null, ['label' => 'form_label_wanted'])
|
||||
->add('wantedReason', null, ['label' => 'form_label_wantedReason', 'help' => 'form_help_wantedReason'])
|
||||
->add('wantedDisplay', null, ['label' => 'form_label_wantedDisplay'])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,18 @@ class DirectoryRepository extends ServiceEntityRepository
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function wantedDisplay()
|
||||
{
|
||||
$this->qb->andWhere('d.wantedDisplay = 1');
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function wantedNotDisplay()
|
||||
{
|
||||
$this->qb->andWhere('d.wantedDisplay = 0');
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function order(array $order)
|
||||
{
|
||||
foreach ($order as $key => $value) {
|
||||
|
||||
Reference in New Issue
Block a user