Friday, February 27, 2015

Re: how is this saving without a table

I did this and i cant see anything unusual

<?php
App::uses('AppModel', 'Model');
/**
 * Subject Model
 *
 * @property Lesson $Lesson
 * @property Student $Student
 * @property Tutor $Tutor
 */
class Term extends AppModel {

    var $displayField = "Title";

    public function get_current_term ( ) {   
        $today = date("Y-m-d");
        return $this->find('first',   array('conditions'=> array('AND' => array(array('Term.start_date <=' => $today), array('Term.end_date >=' => $today)))));;
    }
    
    public function get_neighbors_by_id ( $term_id ) {
        
        return $this->find('neighbors', array('field' => 'id', 'value' => $term_id));
    }
    
   public function get_term_by_id( $term_id ) {
       return $this->read(null, $term_id);
   }
}

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: