Last active
December 8, 2015 20:30
-
-
Save muskie9/ad9dcce496ec58f26ee5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FileUpdateTask extends BuildTask{ | |
protected $title = 'File Update Task'; | |
protected $enabled = true; | |
protected $description = 'Update files from cloud files to normal'; | |
public function run($request){ | |
$updateFile = function($file){ | |
$file->ClassName = ($file->ClassName == 'CloudImage') ? 'Image' : 'File'; | |
$file->write(); | |
}; | |
File::get()->filterAny(array('ClassName' => array('CloudImage', 'CloudFile')))->each($updateFile); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment