So this is my code on my newly created page inside the Entity folder...
use Doctrine\ORM\Mapping as ORM;
use Application\Entity\Categories;
use PerfectWeb\Core\Interfaces\Routable;
use Application\Mapper\Injector;
use PerfectWeb\Core\Traits;
use PerfectWeb\Core\View\Helper\Object;
use PerfectWeb\Core\Utils\Slug;
/**
* @ORM\Entity
*/
class VodCategory extends Categories implements
Entity\Interfaces\Categories, Routable
{
function getRoute($type = Object::ROUTE_TYPE_VIEW)
{
return 'category/categories';
}
function getRouteParams()
{
return
[
Injector::CATEGORY => $this->getID(),
'slug' => Slug::getSlug($this->getSlug()),
];
}
}
And this is my category.php
file:
<?php
namespace Application\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use PerfectWeb\Core\Traits;
/**
* Categories
* @ORM\Table(name="categories")
* @ORM\Entity
*/
class Categories
{
use Traits\Entity;
use Traits\User;
use Traits\Name;
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", nullable=false, unique=false)
*/
protected $name;
/**
* @ORM\ManyToOne(targetEntity="Categories", cascade={"persist"})
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
* @var integer
*/
protected $parent = null;
/**
* @var \Application\Entity\User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="categories")
* @ORM\JoinColumn(name="user", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
/**
*
* @ORM\OneToMany(targetEntity="Videos\Entity\Video", mappedBy="category", fetch="EXTRA_LAZY"))
*
*/
protected $videos;
/**
* @var string
*
* @ORM\Column(name="entity", type="string", nullable=true, unique=false)
*/
protected $entity;
/**
*
* construct function for array collection
*/
public function __construct()
{
$this->videos = new ArrayCollection();
}
/**
* @return mixed
*/
public function getVideos()
{
return $this->videos;
}
/**
* @param mixed $videos
*/
public function setVideos($videos)
{
$this->videos = $videos;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Get parent
*
* @return integer
*/
public function getParent()
{
return $this->parent;
}
/**
* Set parent
*
* @param integer $parent
* @return Categories
*/
public function setParent($parent)
{
$this->parent = $parent;
return $this;
}
public function __toString()
{
return $this->getName();
}
}
the first bit of code gives me an error:
Fatal Error Interface 'Categories\Entity\Interfaces\Categories' not found in /var/www/html/camclients/module/Videos/src/Videos/Entity/VodCategory.php
What am I doing wrong?