19/08/2012 11:33am

PHP | Problem - ImageResource.php


<?php

class ImageResource extends DataObject {
static $api_access = true;

static $has_one = array (
'Image' => 'Image',
'GalleryPage' => 'GalleryPage'
);


public function thumbnail() {
return $this->Attachment()->CroppedImage(150,120);
}

function onBeforeDelete() {
parent::onBeforeDelete();
$this->Attachment->delete();
}
}


Post Comment