I've an existing project in Code Igniter with HMVC extension. Also using php-activerecord through sparc.
For a new module, I created two tables with one-to-many relationship, enforced directly at DB level (in MySQL). Tables are say 'nassignment' (PK id) and 'nassignment_assignee' (FK assignment_id).
Under models, I created two class 'nassignment.php' having class Nassignment and 'nassignment_assignee.php' with class name Nassignment_assignee.
Below is the code I'm trying in controller
$this->load->model("nassignment");
$nAssignmentArr = $this->nassignment->all();
and getting following error
[Fri Aug 02 13:50:52 2013] [error] [client 127.0.0.1] PHP Fatal error: Uncaught
exception 'ReflectionException' with message 'Class Nassignmentassignee does not exist'
in /home/kapil/projects/<project>/application/sparks/php-activerecord/0.0.2/vendor/php-
activerecord/lib/Reflections.php:33\nStack trace:\n#0
/home/kapil/projects/<project>/application/sparks/php-activerecord/0.0.2/vendor/php-
activerecord/lib/Reflections.php(33): ReflectionClass-
>__construct('Nassignmentassi...')\n#1
/home/kapil/projects/<project>/application/sparks/php-activerecord/0.0.2/vendor/php-
activerecord/lib/Relationship.php(286): ActiveRecord\\Reflections-
>add('Nassignmentassi...')\n#2 /home/kapil/projects/<project>/application/sparks/php-
activerecord/0.0.2/vendor/php-activerecord/lib/Relationship.php(281):
ActiveRecord\\AbstractRelationship->set_class_name('Nassignmentassi...')\n#3
/home/kapil/projects/<project>/application/sparks/php-activerecord/0.0.2/vendor/php-
activerecord/lib/Relationship.php(464): ActiveRecord\\AbstractRelationship-
>set_inferred_class_name()\n#4 /home/kapil/projects/<project>/application/sparks/php-
activerecord/0.0 in /home/kapil/projects/<project>/application/sparks/php-
activerecord/0.0.2/vendor/php-activerecord/lib/Reflections.php on line 33
Model code is
nassignment.php
class Nassignment Extends ActiveRecord\Model{
static $table_name = 'nassignment';
//Work fine if I remove following line, but do not get data
static $has_many = array(
array('nassignment_assignee')
);
}
nassignment_assignee.php
class Nassignment_assignee Extends ActiveRecord\Model{
static $table_name = 'nassignment_assignee';
}
Any suggesations, why it is not working