I'm getting the error:
Fatal error: Cannot redeclare class News in application\models\Entities\News.php
The two classes are as follow:
application/models/News_model.php
<?php
require_once(APPPATH."models/Entities/News.php");
class News_model extends CI_Model {
function __construct() {
parent::__construct();
}
}
application/models/Entities/News.php
<?php
use Doctrine\ORM\Mapping as ORM;
/**
* News
*
* @ORM\Table(name="news", indexes={@ORM\Index(name="slug", columns {"slug"})})
* @ORM\Entity
*/
class News {
}
The first class is a model and the last class is entity class for Doctrine.
I cannot see which is the conflict whether the two names are different.
I'm using CodeIgniter 3.1.4.
Anyone has an idea how to solve this issue?
Thanks in advanced!
require_onceout, you may not need it. - aynber