<?php
namespace SabaiApps\Directories\Component\User\EntityType;

use SabaiApps\Directories\Component\Entity\Type\AbstractType;

abstract class AbstractUserEntityType extends AbstractType {

	protected function _entityTypeInfo() {
		$info                = array( 'label' => _x( 'User', 'entity type', 'directories-pro' ) ) + $this->_getEntityTypeInfo();
		$info['properties'] += array(
			'bundle_name' => false,
			'bundle_type' => false,
			'parent'      => false,
			'content'     => false,
			'modified'    => false,
			'author'      => false,
			'status'      => false,
		);
		if ( isset( $info['properties']['title']['field_name'] )
			&& $info['properties']['title']['type'] === 'user_name'
		) {
			$info['properties']['title']['settings'] = array(
				'prefix_field'      => 1,
				'prefixes'          =>
					array(
						0 => 'mr',
						1 => 'mrs',
						2 => 'ms',
					),
				'first_name_field'  => 1,
				'last_name_field'   => 1,
				'display_format'    => '{prefix} {first_name} {last_name}',
				'middle_name_field' => false,
				'suffix_field'      => false,
			);
		}

		return $info;
	}

	abstract protected function _getEntityTypeInfo();

	public function entityTypeTrashEntities( array $entities, ?array $formValues = null ) {}

	public function entityTypeDeleteEntities( array $entities ) {}

	public function entityTypeEntityStatusLabel( $status ) {}
}
