Bin will be removed on June 1, 2014 in favor of http://gist.github.com. Please save all your pastes before then. So long, and thanks for all the fish!×

model

View Paste
  1. <?php
  2.  
  3. /*
  4.  * To change this license header, choose License Headers in Project Properties.
  5.  *...
this is my model
View Paste
  1. // SQL dump of the table structure and one line of data
  2. CREATE TABLE IF NOT EXISTS `users` (
  3.   ...
bin of SQL table structure and User.php (model)
View Paste
  1. $this->Comission->virtualFields = array(
  2.                     'TotalComission' => 'SUM(Comission.value)'
  3.                 );...
View Paste
  1. <?php
  2.  
  3. App::uses('InspiredFilmsAppModel', 'InspiredFilms.Model');
  4.  
  5. /**
  6.  * Rating Model
  7.  *
  8. ...
Anything off here? My Ratings controller says $this->Rating->User is null. As well as Film and Qu...
View Paste
  1. // Post model
  2.  
  3. class Post extends AppModel {
  4.     public $belongsTo = array(
  5.         'User' =>...
View Paste
  1. <?php
  2. App::uses('AppModel', 'Model');
  3. App::uses('ClientesController', 'Controller');
  4.  
  5. /**
  6.  *...
View Paste
  1. <?php
  2. /**
  3.  * Score Model
  4.  *
  5.  * @property User $User
  6.  * @property Post $Post
  7.  */
  8. class Scor...
Score plugin model
View Paste
  1. <?php
  2. /**
  3.  *
  4.  * @author Otavio Augusto
  5.  * @license GPL 3
  6.  * Contato otavioti <nospam> gmail...
Componente adicionar a variavel operador no model Cake2.x
View Paste
  1.  
  2. /**
  3.  * testValidate method
  4.  *
  5.  * @return void
  6.  */
  7.     public function testValidate() {
  8.         $Fi...
Replaces existing testValidate in CakeValidationSeTest.php
View Paste
  1. //Temp model in import function
  2.         $RemoteHeader = new AppModel(array(
  3.                    ...
see problem definition
View Paste
  1.         $data = $RemoteHeader->find('all', array(
  2.             'fields' => array(
  3.               ...
temp model w/ join condition fails
View Paste
  1. Database Error
  2.  
  3. Error: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or upda...
insert error.
View Paste
  1.     public function saveLocal($data) {
  2.  
  3.         $this->_rebindModels();
  4.  
  5.         foreach ($da...
saveLocal
View Paste
  1.     protected function _rebindModels() {
  2. //        reload models and switch keys to load data lo...
rebindModels
View Paste
  1. <?php
  2.  
  3. class InvoiceDetail extends AppModel {
  4.  
  5.     public $name = 'InvoiceDetail';
  6.     publi...
InvoiceDetail model
View Paste
  1. <?php
  2.  
  3. class InvoiceHeader extends AppModel {
  4.  
  5.     public $name = 'InvoiceHeader';
  6.     publi...
InvoiceHeader model
View Paste
  1. Warning (2): in_array() expects parameter 2 to be array, boolean given [CORE\Cake\Model\Model.php...
saveAssociated() error
View Paste
  1. Warning (2): Invalid argument supplied for foreach() [CORE\Cake\Model\Model.php, line 2053]
  2. Code...
saveAll error
View Paste
  1. (
  2.     [0] => Array
  3.         (
  4.             [InvoiceHeader] => Array
  5.                 (
  6.  ...
invoice data
View Paste
  1.     public function index() {
  2. //      Set data to local variable    
  3.         $this->TempHeader-...
index function not saving data.