Skip to content

Instantly share code, notes, and snippets.

@alexdd55
alexdd55 / gist:642713bef9aa29b051cbc76c411b70b1
Last active February 25, 2020 13:28
cake model relations and joins on orm
/* SQL Statement */
DROP DATABASE IF EXISTS `moviestest`;
CREATE DATABASE IF NOT EXISTS `moviestest` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `moviestest`;
DROP TABLE IF EXISTS `categories`;
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
<?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt