Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class PublishAllListings extends CliController {
- function process() {
- $listings = DataObject::get('SborListing');
- foreach($listings as $listing) {
- echo "Publishing: ".$listing->Title."\n";
- $listing->Status = 'Published';
- $listing->writeToStage('Stage');
- $listing->publish('Stage','Live');
- $listing->write();
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment