[Isocial-svn] SF.net SVN: isocial: [218] app/models/photoapp_photo.php
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <fsn...@us...> - 2008-05-23 16:47:36
|
Revision: 218 http://isocial.svn.sourceforge.net/isocial/?rev=218&view=rev Author: fsnobody Date: 2008-05-23 09:47:42 -0700 (Fri, 23 May 2008) Log Message: ----------- fix in deleting albums Modified Paths: -------------- app/models/photoapp_photo.php Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-23 16:24:56 UTC (rev 217) +++ app/models/photoapp_photo.php 2008-05-23 16:47:42 UTC (rev 218) @@ -4,15 +4,11 @@ { var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); - /*function __constructor() { - echo 1; - die(); - $album = new PhotoappAlbum(); - return parent::__constructor(); - }*/ - function beforeDestroy() { - if ($album_cover = $this->album->findFirst("img = '" . $this->img . "'")) { + + $album_cover = $this->album->find('first', "img = '" . $this->img . "'"); + //$this->debug($album_cover); + if ($album_cover) { $album_cover->img = ""; $album_cover->save(); } @@ -23,6 +19,12 @@ return parent::beforeDestroy(); } + function debug($str) { + echo "<pre>"; + print_r($str); + echo "</pre>"; + } + } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |