General mixed stuff about CakePHP, Delta Search

Q1 : how to print query of find cakephp? ans: $log = $this->getDataSource()->getLog(false, false); debug($log); Q2: Socket transport “ssl” in PHP not enabled? ans: Rename php.ini-production to php.ini (in C:\xampp\php\ folder) Edit php.ini and uncomment extension_dir=ext. Also uncomment extension=php_openssl.dll. Q3. how to close current tab ans: window.open(”,’_self’).close();   Q4: How to remove Delta search: I have … Read more

condition in find function cakephp

How to get data on condition that start time only have current year data: [php] $event = $this->Event->find(‘first’, array( ‘conditions’ => array( ‘Event.id’ => $targetEvent[‘Eventtarget’][‘event_id’], ‘Event.stage’ => ‘created’, ‘year(Event.startTime)’ => date(‘Y’) ), //this is the condition we have to check ‘fields’ => array(‘Event.startTime’, ‘Event.city’, ‘Event.zip’, ‘Event.employee_id’) )); [/php]

CakePHP cake bake command

step 1: set path to environment variable. like: C:\xampp\php;C:\xampp\htdocs\yourproject\lib\cake\console\; step 2: open command prompt and type cd C:\xampp\htdocs\yourproject\app  and press enter. step 3: now type cake bake now you can see the options there. you can continue accordingly.