Skip to content

Instantly share code, notes, and snippets.

View cpierce's full-sized avatar

Chris Pierce cpierce

View GitHub Profile
public function storeAdvancedCSS($cssID)
{
global $site;
$file = new TextFile($site->userFiles, 'css'.$cssID.'.css');
if ($site->S3_ON) {
S3New::getInstance()->deleteFile($site->S3_SITE_FOLDER.'/css'.$cssID.'.css');
//TODO: This would be a prime place to invalidate our cache because we know that we are about to delete the file.
//However it shouldn't be needed because the code attempts, to re-create the same file that we just deleted. Placing here for the future.
if (constant('ENVIRONMENT') != 'production') {
<?php
echo 'hello world';
class SponsorDivisionsController extends AppController {
public function index() {
$this->SponsorDivision->Behaviors->load('Containable');
$sponsordivisions = $this->SponsorDivision->find('all', array(
'contain' => array(
'Sponsor',
),
'order' => array(
'SponsorDivision.SponsorDivision' => 'asc'),
),
<?php
/* Model/Sponsor.php */
class Sponsor extends AppModel {
public $name = 'Sponsor';
public $useTable = 'Sponsors';
public $displayField = 'Sponsor';
public $primaryKey = 'SponsorID';
public $hasMany = array(
'SponsorDivision' => array(
'className' => 'SponsorDivision',
<?php
App::uses('AppModel', 'Model');
/**
* Sponsor.php Model
*
* @author Chris Pierce <cpierce@csdurant.com>
*/
class Sponsor extends AppModel {
$hasManys = [
];
foreach ($hasManys as $hasMany) {
$this->hasMany($hasMany);
}
Router::prefix('admin', function ($routes) {
$routes->connect('/:controller');
});