Class ‘App\Model\BaseEntity’ not found

Notice: This thread is very old.
zdeno
Member | 13
+
-1
-

Hi,

if a wont model in presenter
$project = new \App\Model\Project();
so
Class ‘App\Model\BaseEntity’ not found

<?php
namespace App;

class Project extends BaseEntity
{
    protected $id;
    protected $projectID;
    protected $title;
	...
}
?>

presenter

<?php
namespace App\Presenters;
use Nette;
use \Nette\Application\UI\Form as Form;


class TaskPresenter extends ProtectedPresenters
{

	public function renderDefault($name)
	{
		$project = new \App\Project();
	}

}
?>

thanks
best regards :)
zdeno

Last edited by zdeno (2016-05-21 19:58)

Jan Mikeš
Member | 771
+
+1
-

Check your namespaces, there are inaccuracies in what you write and what is in your code.
You write $project = new \App\Model\Project();, but in code you have $project = new \App\Project();

As well referring to your code, you CAN NOT get error message Class ‘App\Model\BaseEntity’ not found because you are extending \App\BaseEntity class

zdeno
Member | 13
+
0
-

och,
BaseEntity is doctrine class not nette :D
thanks, it's working now