Add entity for logging of filtered hubs. #543
This commit is contained in:
parent
0ecc55cf56
commit
2db7c6791f
2 changed files with 84 additions and 0 deletions
83
src/Entity/HubFilterLog.php
Normal file
83
src/Entity/HubFilterLog.php
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
use App\Entity\Hub;
|
||||
|
||||
use DateTime;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="hub_filter_log")
|
||||
*/
|
||||
class HubFilterLog
|
||||
{
|
||||
// unique id
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
// date created
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
protected $date_create;
|
||||
|
||||
// hub that was not included in results
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Hub", inversedBy="hub_filtered")
|
||||
* @ORM\JoinColumn(name="hub_filtered_id", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
protected $hub;
|
||||
|
||||
// filter that eliminated hub
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
* @Assert\NotBlank()
|
||||
*/
|
||||
protected $filter_type_id;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getDateCreate()
|
||||
{
|
||||
return $this->date_create;
|
||||
}
|
||||
|
||||
public function setHub(Hub $hub)
|
||||
{
|
||||
$this->hub = $hub;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHub()
|
||||
{
|
||||
return $this->hub;
|
||||
}
|
||||
|
||||
public function setFilterTypeId($filter_type_id)
|
||||
{
|
||||
$this->filter_type_id = $filter_type_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFilterTypeId()
|
||||
{
|
||||
return $this->filter_type_id;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@ class HubCriteria
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
// TODO: default values might still change
|
||||
$this->limit_results = 10;
|
||||
$this->limit_distance = 500;
|
||||
$this->jo_type = '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue