Skip to main content
added 157 characters in body
Source Link
donquixote
  • 3.7k
  • 24
  • 41

Bugs bugs bugs.

    'entity class' => 'Drupal/myentity/class/MyEntity',
    'controller class' => 'Drupal/myentity/controller/MyEntityController',

This should be

    'entity class' => 'Drupal\myentity\class\MyEntity',
    'controller class' => 'Drupal\myentity\controller\MyEntityController',

And:

namespace Drupal\myentity\class\MyEntity;

This should be

namespace Drupal\myentity\class;

(and btw, is "class" really a valid namespace part? Won't PHP complain?)

And:

sites\all\modules\myentity\lib\Drupal\controller\MyEntityController.php

This should be:

sites\all\modules\myentity\lib\Drupal\myentity\controller\MyEntityController.php

EDIT: One more:

class MyEntity extends Entity {

should be

class MyEntity extends \Entity {

Because class Entity is in root namespace.

Bugs bugs bugs.

    'entity class' => 'Drupal/myentity/class/MyEntity',
    'controller class' => 'Drupal/myentity/controller/MyEntityController',

This should be

    'entity class' => 'Drupal\myentity\class\MyEntity',
    'controller class' => 'Drupal\myentity\controller\MyEntityController',

And:

namespace Drupal\myentity\class\MyEntity;

This should be

namespace Drupal\myentity\class;

(and btw, is "class" really a valid namespace part? Won't PHP complain?)

And:

sites\all\modules\myentity\lib\Drupal\controller\MyEntityController.php

This should be:

sites\all\modules\myentity\lib\Drupal\myentity\controller\MyEntityController.php

Bugs bugs bugs.

    'entity class' => 'Drupal/myentity/class/MyEntity',
    'controller class' => 'Drupal/myentity/controller/MyEntityController',

This should be

    'entity class' => 'Drupal\myentity\class\MyEntity',
    'controller class' => 'Drupal\myentity\controller\MyEntityController',

And:

namespace Drupal\myentity\class\MyEntity;

This should be

namespace Drupal\myentity\class;

(and btw, is "class" really a valid namespace part? Won't PHP complain?)

And:

sites\all\modules\myentity\lib\Drupal\controller\MyEntityController.php

This should be:

sites\all\modules\myentity\lib\Drupal\myentity\controller\MyEntityController.php

EDIT: One more:

class MyEntity extends Entity {

should be

class MyEntity extends \Entity {

Because class Entity is in root namespace.

Source Link
donquixote
  • 3.7k
  • 24
  • 41

Bugs bugs bugs.

    'entity class' => 'Drupal/myentity/class/MyEntity',
    'controller class' => 'Drupal/myentity/controller/MyEntityController',

This should be

    'entity class' => 'Drupal\myentity\class\MyEntity',
    'controller class' => 'Drupal\myentity\controller\MyEntityController',

And:

namespace Drupal\myentity\class\MyEntity;

This should be

namespace Drupal\myentity\class;

(and btw, is "class" really a valid namespace part? Won't PHP complain?)

And:

sites\all\modules\myentity\lib\Drupal\controller\MyEntityController.php

This should be:

sites\all\modules\myentity\lib\Drupal\myentity\controller\MyEntityController.php