<?php
namespace SabaiApps\Directories\Component\DirectoryPro\SystemTool;

use SabaiApps\Directories\Component\System\Tool\AbstractExportJsonTool;
use SabaiApps\Directories\Context;

class ExportDisplaySystemTool extends AbstractExportJsonTool {

	protected function _systemToolInfo() {
		return array(
			'hidden' => true,
		);
	}

	protected function _getDefaultJsonFileName( ?Context $context = null ) {
		return $context->display->name;
	}

	protected function _export( array $settings, ?Context $context = null ) {
		return $this->_application->Filter(
			'directory_admin_directory_export_display',
			array(
				'entity_type' => $context->bundle->entitytype_name,
				'bundle_type' => $context->bundle->type,
				'bundle_name' => $context->bundle->name,
			) + $this->_application->Display_Display_export( $context->display ),
			array( $context->display )
		);
	}
}
