Category: Models & ORM

Saving multiple records and get the last inserted Id in ORM

I'm thinking about saving multiple records at once and then get the last Id in cakephp.From the cake doc (saving data at a time), I know that if you are saving one record:use Cake\ORM\TableRegistry;

#orm
1 Answers
RJ
RJ

4

Category: Models & ORM

Cakephp find data that was created one month ago

I am working on an API service for creating financial reports. Now I want to limit the application: Not to create a new report if there was already an existing report that created in the past one


1 Answers

Category: Models & ORM

In CakePHP 3, find 10 random blog posts from mysql fast

based on this article: MySQL select 10 random rows from 600K rows fastI am thinking about finding random blog posts in CakePHP. How to use RAND()in query builders?In addition, can you speed

#sql
2 Answers

Category: Models & ORM

In CakePHP 3, Inner join and count records

I want to count female employees per department in CRM, how to build custom query in CakePHP?SELECT     EMP.DeptNo, DEP.DeptName, count(*) AS records FROM    &n

#sql
1 Answers

Category: Models & ORM

In CakePHP 3, identify and remove duplicate records of customers

This is my customers table (example)idnamephonesexstage1John123-456789m02Mary459-234321f33Liza123-123414f14John123-456-789m35Kate999-000999f0...I want to identify and remove duplicate records of custo

#sql
1 Answers

Category: Models & ORM

Cakephp use query builder in component

How to use Cakephp query builder in component? (PostutilsComponent.php)//controller public function blogPost($post_id = null) {     $this->set('recent_posts', $this->P


0 Answers

Category: Models & ORM

Update all records using updateAll() and SQL IN clause

I am using Cakephp 3 latest version and I want to update a gender column for multiple rows. I have studied the ORM documentation and I have no idea how to NOT use foreach loop to update multiple rows

SOLVED #sql #updateall
2 Answers
achao
achao

9

Category: Models & ORM

What is the best way to load Models in Controller, Cakephp 2?

I would like to ask you all how to speed up/load models in the best way? Take my contacts controller for example:<?php App::uses('AppController', 'Controller'); App::uses('Sanitize', 'Utility')

#memory #models
1 Answers
Harper
Harper

5

Category: Models & ORM

Cakephp counting occurrence of duplicate values in find();

This is my code:$ids = $this->Match->find('all', array('fields' => array('category_id'), 'conditions' => array('event_id' => $event_id, 'sort > ' => 0, 'finished' => 0, 'create

SOLVED #duplicate
2 Answers
Pidara
Pidara

4

Category: Models & ORM

Model fields created and modified are not saved to mysql

Model fields `created` and `modified` should be saved to database on Model.save. Every fields expect for `created` and `modified` are working fine (not null), which should be working on every save or

#save
3 Answers

Welcome to Aero Coding!

Aero Coding is a CakePHP-focused Q&A community for professional and enthusiast cake bakers. It's built and run by you as part of the community.


Join Now Tour

Download Cakephp

Start baking your own CakePHP application!


Cakephp All Versions