Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $belongsTo = array(
- 'Company' => array(
- 'className' => 'Company',
- 'foreignKey' => 'company_id',
- 'dependent' => false,
- ),
- );
- var $hasMany = array(
- 'User' => array(
- 'className' => 'User',
- 'foreignKey' => 'company_id',
- 'dependent' => false
- ),
- 'Customer'=>array(
- 'className' => 'Customer',
- 'foreignKey' => 'company_id',
- 'dependent' => false
- )
- );
- var $belongsTo = array(
- 'Company' => array(
- 'className' => 'Company',
- 'foreignKey' => 'company_id',
- 'dependent' => false,
- ),
- );
- echo $this->Form->input('Customer.customer_nr');
- echo $this->Form->input('Customer.name');
- echo $this->Form->input('Customer.phone');
- echo $this->Form->input('Customer.email');
- echo $this->Form->input('Customer.address');
- echo $this->Form->input('Customer.post_nr');
- echo $this->Form->input('Customer.city');
- echo $this->Form->input('Customer.company_id', array('value' => $current_user['company_id'], 'type'=>'hidden'));
- Error: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'name' in where clause is ambiguous
- function add() {
- if (!empty($this->data) ) {
- $this->Customer->create();
- if ($this->Customer->save($this->data)) {
- $this->Session->setFlash(__('Customer was saved'), 'positive_notification');
- $this->redirect(array('controller'=>'events', 'action' => 'dashboard'));
- } else {
- $this->Session->setFlash(__('Customer has been saved. Please, try again'), 'negative_notification');
- }
- }
- 'conditions' => array(
- 'name' => 'john'
- )
- 'conditions' => array(
- 'User.name' => 'john'
- )
- 'conditions' => array(
- 'name' => 'john'
- ),
- 'recursive' => -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement