<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Install_Import_Phpfox_CleanupPost extends Install_Import_Phpfox_Abstract
{

  protected $_toTableTruncate = false;
  protected $_priority = 0;

  protected function _run()
  {
    $this->getToDb()->query("DELETE FROM engine4_album_photos WHERE file_id=0");
    $this->getToDb()->
      query("
            DELETE FROM engine4_album_albums where album_id in 
            (
                SELECT * FROM (
                                    SELECT engine4_album_albums.album_id 
                                    FROM engine4_album_albums
                                    LEFT JOIN engine4_album_photos ON engine4_album_albums.album_id = engine4_album_photos.album_id
                                    where engine4_album_photos.photo_id is null
                                ) as p 
            );
        ");
  }

  protected function _translateRow(array $data, $key = null)
  {
    return false;
  }
}
