Guest User

Untitled

a guest
Jul 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. class PublishAllListings extends CliController {
  4.  
  5. function process() {
  6.  
  7. $listings = DataObject::get('SborListing');
  8. foreach($listings as $listing) {
  9. echo "Publishing: ".$listing->Title."\n";
  10. $listing->Status = 'Published';
  11. $listing->writeToStage('Stage');
  12. $listing->publish('Stage','Live');
  13. $listing->write();
  14. }
  15.  
  16. }
  17.  
  18.  
  19. }
  20.  
  21. ?>
Add Comment
Please, Sign In to add comment