For the above code, let's say i have two tables : company_proj_jobs_ref, and company_proj_files_ref with many files_ref for one jobs_ref. I made too model classes : JobsRef and FilesRef.
The following code will fail :
$job = new JobsRef($existing_pk);
$job->store();
With an error like the one bellow :
Mon Feb 15 11:57:35 2010 error 141.33.102.211 PHP Fatal error: Uncaught exception 'fProgrammerException' with message 'The noun specified could not be singularized' in /opt/apache/***/fGrammar.php:517
nStack trace:
n#0 /opt/apache/***/fORM.php(337): fGrammar::singularize('company_proj_files_...')
n#1 /opt/apache/***/fActiveRecord.php(2668): fORM::classize('company_proj_files_...')
n#2 /opt/apache/+++/ajax.php(196): fActiveRecord->store()
n#3 /opt/apache/+++/index.php(18): include('/opt/apache/...')
n#4 {main}
n thrown in /opt/apache/***/fGrammar.php on line 517, referer: xxx
Reason : in the method fORM::classize, it does not find the related table in the table-to-class array, and then tries to find it by singularizing/camelizing the table name, and fails at it.
When calling $activate = new FilesRef(); previously, it loads the table to class reference into fORM and classize works.
I am not sure of the actual PHP code that produces an error. If the one i provide does not actually fails for you, i can look into it further to provide the code that is failing.