I guess you have no Class "InvoiceRows" in your Models. I think your
Invoice AppModel should be something like:
...
var $hasMany = array(
'InvoiceRows' => array( // I guess that is ok for the name
'className' => 'Invoice', // <-- this one has to be a name of
an actually existing Model/Table
.....
Am 06.06.2010 21:09, schrieb Christopher Hanson:
hey, i tried the following
<?php
class Invoice extends AppModel
{
var $name = 'Invoice';
var $actAs = array('Containable');
var $hasMany = array(
'InvoiceRows' => array(
'className' => 'InvoiceRows',
'foreignKey' => 'invoice_id',
'order' => 'InvoiceRows.delta ASC',
),
);
var $belongsTo = array(
'Client' => array(
'className' => 'Client',
),
);
}
and
<?php
class InvoicesController extends AppController
{
var $name = 'Invoices';
function index(){}
function view($invoice_id)
{
$this->Invoice->contain('Country');
$data = $this->Invoice->find('all');
//$data = $this->Invoice->findById($invoice_id);
debug($data);
$this->set('client_data', $data);
}
}
also even if i try contain(); it still comes back with this error
*Warning* (512) <javascript:void(0);>:*SQL Error:* 1064: You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'contain' at line 1
[*CORE\cake\libs\model\datasources\dbo_source.php*, line*673*]
Chris
--
Best Regards Christopher Hanson
Check out the new CakePHP Questions site http://cakeqs.org and help
others with their CakePHP related questions.
You received this message because you are subscribed to the Google
Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this
group at http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en