public function addMapping(string $entity, string $storage, callable $toEntityCb = null, callable $toStorageCb = null): StorageReflection
	{
		if (isset($this->mappings[self::TO_ENTITY][$storage])) {
			throw new InvalidStateException("Mapping for $storage column is already defined.");
		} elseif (isset($this->mappings[self::TO_STORAGE][$entity])) {
			throw new InvalidStateException("Mapping for $entity property is already defined.");
		}

		$this->mappings[self::TO_ENTITY][$storage] = [$entity, $toEntityCb];
		$this->mappings[self::TO_STORAGE][$entity] = [$storage, $toStorageCb];
		return $this;
	}
public function addMapping(string $entity, string $storage, callable $toEntityCb = null, callable $toStorageCb = null): StorageReflection
	{
		if (isset($this->mappings[self::TO_ENTITY][$storage])) {
			throw new InvalidStateException("Mapping for $storage column is already defined.");
		} elseif (isset($this->mappings[self::TO_STORAGE][$entity])) {
			throw new InvalidStateException("Mapping for $entity property is already defined.");
		}

		$this->mappings[self::TO_ENTITY][$storage] = [$entity, $toEntityCb];
		$this->mappings[self::TO_STORAGE][$entity] = [$storage, $toStorageCb];
		return $this;
	}
public function addMapping ( string $ entity , string $ storage , callable $ toEntityCb = null , callable $ toStorageCb = null ) : StorageReflection { if ( isset ( $ this -> mappings [ self :: TO_ENTITY ] [ $ storage ] ) ) { throw new InvalidStateException ( "Mapping for $storage column is already defined." ) ; } elseif ( isset ( $ this -> mappings [ self :: TO_STORAGE ] [ $ entity ] ) ) { throw new InvalidStateException ( "Mapping for $entity property is already defined." ) ; } $ this -> mappings [ self :: TO_ENTITY ] [ $ storage ] = [ $ entity , $ toEntityCb ] ; $ this -> mappings [ self :: TO_STORAGE ] [ $ entity ] = [ $ storage , $ toStorageCb ] ; return $ this ; }
Adds mapping.
@throws InvalidStateException Throws exception if mapping was already defined.
Adds mapping .