Try to unset object inside ResultSet Cakephp3

i'm trying to unset an Object inside my Result set. Not is a property inside, are the Users objects that not match with the filter selected by user on search page. My table have hasMany association but for this case i need only check the first object...
more »

2017-09-14 21:09 (1) Answers

Update entity on save rather than insert

In my code I am trying to create a lock entity when a controller function is called. Once I create the new entity I save this in the database. Once the controller function finishes the rest of its logic I update the lock entity before I return the re...
more »

2017-09-14 18:09 (0) Answers

CakePHP 3 - 500 Internal Server Error

I am using Ubuntu 17.04 and I have recently installed latest version of CakePHP. It works well on my localhost but not working on server. It just shows 500 Internal Error. I already have CakePHP projects running on my server but only cakephp setups ...
more »

2017-09-14 13:09 (2) Answers

cakephp 3 save empty belongsToMany relation

I have a Shops table which can have Products. Other Shops can have the same Products so I used a belongsToMany relation table ShopsProducts. I can add an infinite number of Products to a Shop and remove them by saving the Shop entity including the r...
more »

2017-09-14 11:09 (1) Answers

setup route for cakephp3 html url

I have URL like article_title_page-c-31-c-2.html where I want to map to the articles controller and action category, where article_title_page can be any value, the number 31 and 2 will be pass as parameter to the action category, and -c- and -c- is...
more »

2017-09-14 07:09 (1) Answers

Custom Finder Methods error in cakephp 3

I have a Custom Finder Method in the model and trying to call it in the controller it is not found. follows the code in the model VehiclesTable.php: public function listarVeiculosDisponiveis(Query $query, array $options) { return $query->whe...
more »

2017-09-13 17:09 (0) Answers

Cakephp Find between dates

Good day. Please i want to select rows from the table "Vehicle_insurance" where expiry_date is greater than start_date and less than expiry_date. start_date and expiry_date must have been filled and submitted from a form. Below is my code but its not...
more »

2017-09-13 14:09 (0) Answers

How deal with related fixtures

I am using phpunit to test my CakePHP application, however, I have created two fixtures:- A and B. A gets inserted first and B second, but B also has a a_id field that I need to fill from the first fixture. A good example of what I mean exists in th...
more »

2017-09-13 11:09 (1) Answers

cakephp 3 installation error with composer

I have Php 7 installed but whenever I try to install CakePHP from the command line using composer I get this error: Your version of PHP, 5.4.0beta2-dev, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly sugge...
more »

2017-09-13 05:09 (1) Answers

Uppercase related objects in CakePHP 3

I'm using CakePHP with Firebird database with plugin cakephp-firebird-driver, and I need convert the related object keys to uppercase. Controller: $this->paginate = [ 'contain' => ['Fazendas'] ]; Result: { "LOTES": [ { "...
more »

2017-09-12 16:09 (2) Answers

Using CakePHP-Auth-Forgot-Password

I am using the github repository code here: https://github.com/hunzinker/CakePHP-Auth-Forgot-Password The program doesn't send me an email as it should. Is there anyone that's used and modified this code? What did you change? ...
more »

2017-09-12 13:09 (0) Answers

Cakephp 3 newEntity() not working

I have to maintenance the cakephp 3 project and in this project, they have create newEntity using array variable and then data are not save into database. I set print_r to get result of userModel but it doesn't show anything. I was using nginx serv...
more »

2017-09-12 12:09 (0) Answers

Issue with belongsTo and hasMany in CakePHP

I'm facing an issue with my models. I have a controller 'Jobapplications' linked with a 'History' model : public $hasMany = array( 'History' => array( 'order' => array('History.created' => 'DESC') ) ); 'History' model cont...
more »

2017-09-12 10:09 (0) Answers

CakePhp 2.6.3 Not Working on PHP 7

Fatal error: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340 Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error...
more »

2017-09-12 09:09 (2) Answers

Cake php get comma seprated value from mysql table

I am trying to fetch a comma separated record in PHP from a MySQL i am not getting any error but i am getting not all record. The SQL code I want to execute is: SELECT Batches.id, Batches.batch_name, Batches.facilities_id, Batches.archive_status, B...
more »

2017-09-12 08:09 (1) Answers

Join query in Cakephp missing results

I'm having troubles with a Cakephp join query. My database is built this way : Contact belongsTo User In my contact Controller, I have a fucntioin that search Contacts. Contacts can be searched by User.first_name or User.last_name. I built my quer...
more »

2017-09-11 09:09 (1) Answers

Robust built-in security in PHP frameworks

I come from the background of .Net. My new client is pushing hard to make use of open source frameworks (specifically LAMP stack) for development of upcoming projects with Application security and response time as key parameters. I have spent good t...
more »

2017-09-11 06:09 (0) Answers

Connection refused Error cakephp

I can't send an email through a website that is that is hosted, on localhost it works normally, but since it was hosted it doesn't. I made the hosting by the godaddy. email.php: class EmailConfig { public $smtp = array( 'transport' => 'Smtp', 'f...
more »

2017-09-10 22:09 (0) Answers

Undefined index: token Error

I am using the github repository code here: https://github.com/hunzinker/CakePHP-Auth-Forgot-Password I have used the following function in my UsersController.php. I get the error Undefined index: token on the line that has a comment before it. What...
more »

2017-09-10 14:09 (1) Answers

CakePHP 3 Embedded Video File Not Showing

I am trying to embed a video file using cakephp 3 for helper with this : <?= $this->Html->media('video.mp4', [ 'fullBase' => true, 'text' => 'Fallback text' ]) ?> According to the doc #linking-to-videos-and-audio-fil...
more »

2017-09-10 00:09 (0) Answers

Admin index route ignored w/ CakePHP 2.1

I'm working on a CakePHP 2.1 project and I have an issue concerning the "homepage" for admin panel. When I enter : mysite.com/admin I have a message telling me "AdminController cannot be found". I declared this route in config/routes.php : Router:...
more »

2017-09-08 16:09 (1) Answers