Skip to content

Instantly share code, notes, and snippets.

public function getowner() {
$id = $this->request->get('id');
$data = $this->Powners->get($id);
$this->set(compact('data'));
$this->set('_serialize', ['data']);
}
@ceeram
ceeram / find.php
Last active December 18, 2015 03:59
<?php
public function specificAccessSpeeds() {
$specificAccessType_id = $this->request->data['Service']['specific_access_type_id'];
$Model = ClassRegistry::init('SpecificAccessTypesAccessSpeed');
$Model->virtualFields['custom'] = 'AccessSpeed.name';
$specificAccessSpeeds = $Model->find( 'list', array(
'conditions' => array( 'SpecificAccessTypesAccessSpeed.specific_access_type_id' => $specificAccessType_id ),
'recursive' => -1,
@ceeram
ceeram / trait.php
Created November 17, 2012 17:53 — forked from lorenzo/trait.php
trait foo { function bob() { echo 'from trait'; }}
class bar { use foo { bob as likeBob }; function bob() { $this->likeBob();}}
class baz extends bar { function bob() { parent::bob(); echo ' from child'; }}
$a = new baz;
$a->bob();
//result: from trait from child
@ceeram
ceeram / readme.textile
Created January 6, 2012 21:19 — forked from josegonzalez/readme.md
Example Readme for CakePHP plugins that use MIT license

[PLUGIN NAME] Plugin

[ONE LINE DESCRIPTION OF PROJECT]

Background

[A PARAGRAPH DESCRIBING WHY YOU BUILT THIS]

[ANOTHER PARAGRAPH DESCRIBING YOUR IMPETUS FOR RELEASING THIS]