<?php
namespace SabaiApps\Directories\Component\Notification\Event;

class PostExpiredEvent extends AbstractEntityEvent {

	protected function _notificationEntityEventInfo() {
		return array(
			'label'            => _x( 'Post expired', 'notification event', 'directories-pro' ) . ' - %s',
			'default_settings' => array(),
			'actions'          => array(
				'entity_entities_expired',
			),
			'weight'           => 7,
		);
	}

	public function notificationEventMessages( array $settings, array $params ) {
		return new EntityEventMessageIterator( $params[1], $settings );
	}

	protected function _getDefaultNotificationLabel() {
		return sprintf( __( 'Your %1$s has expired', 'directories-pro' ), strtolower( $singular = $this->_getContentTypeLabel() ), $singular );
	}

	protected function _getDefaultNotificationBody() {
		return array(
			sprintf(
				__( 'The following %1$s that you have submitted has expired.', 'directories-pro' ),
				strtolower( $singular = $this->_getContentTypeLabel() ),
				$singular
			),
			'%title%' . PHP_EOL . '%permalink_url%',
		);
	}
}
