<?php
namespace SabaiApps\Directories\Component\Field\Type;

use SabaiApps\Directories\Component\Field\IField;
use SabaiApps\Directories\Component\Entity\Model\Bundle;
use SabaiApps\Directories\Component\Entity\Type\IEntity;

interface IType {

	public function fieldTypeInfo( $key = null );
	public function fieldTypeSettingsForm( $type, Bundle $bundle, array $settings, array $parents = array(), array $rootParents = array() );
	public function fieldTypeSchemaType( $type, $name );
	public function fieldTypeSchema( array $settings = array() );
	public function fieldTypeOnSaveValues( IField $field, array $values, ?array $currentValues = null, array &$extraArgs = array() );
	public function fieldTypeOnLoadValues( IField $field, array &$values, IEntity $entity, array $allValues );
	public function fieldTypeOnSaved( IField $field );
	public function fieldTypeOnRemoved( IField $field );
	public function fieldTypeDefaultValueForm( $type, Bundle $bundle, array $settings, array $parents = array() );
	public function fieldTypeSupports( Bundle $bundle );
	public function fieldTypeReadableInfo( IField $field );
	public function fieldTypeInitialSettings( $name, Bundle $bundle, array $settings );
	public function fieldTypeOnValuesSaved( IField $field, array $values, IEntity $entity, ?array $oldValues = null );
}
