$dataConverter App\Core\Lib\DataConverter\DataConverter#82 (2)
  • Properties (2)
  • Methods (10)
  • protected dataCaster -> App\Core\Lib\DataCaster\DataCaster#83 (2)
    • Properties (2)
    • Methods (5)
    • private types -> array (0)
      private castHandlers -> array (14)
      array => string (38) "App\Core\Lib\DataCaster\Cast\ArrayCast"
      bool => string (40) "App\Core\Lib\DataCaster\Cast\BooleanCast"
      boolean => string (40) "App\Core\Lib\DataCaster\Cast\BooleanCast"
      csv => string (36) "App\Core\Lib\DataCaster\Cast\CSVCast"
      datetime => string (41) "App\Core\Lib\DataCaster\Cast\DatetimeCast"
      date => string (37) "App\Core\Lib\DataCaster\Cast\DateCast"
      double => string (38) "App\Core\Lib\DataCaster\Cast\FloatCast"
      float => string (38) "App\Core\Lib\DataCaster\Cast\FloatCast"
      int => string (40) "App\Core\Lib\DataCaster\Cast\IntegerCast"
      integer => string (40) "App\Core\Lib\DataCaster\Cast\IntegerCast"
      int-bool => string (40) "App\Core\Lib\DataCaster\Cast\IntBoolCast"
      json => string (37) "App\Core\Lib\DataCaster\Cast\JsonCast"
      timestamp => string (42) "App\Core\Lib\DataCaster\Cast\TimestampCast"
      uri => string (36) "App\Core\Lib\DataCaster\Cast\URICast"
    • public __construct(?array $castHandlers = null, ?array $types = null) Constructor. Optionally merges custom cast handlers and field type definitions.
      /**
       * Constructor.
       * Optionally merges custom cast handlers and field type definitions.
       * @param array<string,class-string>|null $castHandlers Optional custom cast handlers to merge.
       * @param array<string,string>|null $types Optional type definitions for fields.
       */
      
      Defined in .../app/Core/Lib/DataCaster/DataCaster.php:63
      public addCastHandlers(array $handlers): static Adds or overrides cast handlers.
      /**
       * Adds or overrides cast handlers.
       * @param array<string,class-string> $handlers
       * @return $this
       */
      
      Defined in .../app/Core/Lib/DataCaster/DataCaster.php:79
      public castAs($value, string $field, string $method = 'get'): mixed Casts a value according to its configured type for a given field. Supports nu...
      /**
       * Casts a value according to its configured type for a given field.
       * Supports nullable types prefixed with '?' and parameterized types like "json[array]".
       * @param mixed $value Value to be cast.
       * @param string $field Field name to determine type for.
       * @param 'get'|'set' $method Determines which handler method to call.
       * @return mixed
       * @throws DataCasterException If invalid cast method or nullability rules are violated.
       * @throws InvalidArgumentException If no handler exists for the given type.
       */
      
      Defined in .../app/Core/Lib/DataCaster/DataCaster.php:108
      public getTypes(): array Returns the mapping of field names to their cast types.
      /**
       * Returns the mapping of field names to their cast types.
       * @return array<string,string>
       */
      
      Defined in .../app/Core/Lib/DataCaster/DataCaster.php:160
      public setTypes(array $types): static Sets the mapping of field names to their cast types.
      /**
       * Sets the mapping of field names to their cast types.
       * @param array<string,string> $types
       * @return $this
       */
      
      Defined in .../app/Core/Lib/DataCaster/DataCaster.php:170
    protected dataMapper -> App\Core\Lib\DataMapper\DataMapper#84 (2)
    • Properties (2)
    • Methods (6)
    • protected dataMap -> array (0)
      protected useCamelCaseMapping -> boolean true
    • public __construct(array $dataMap, bool $useCamelCaseMapping) DataMapper constructor.
      /**
       * DataMapper constructor.
       * @param array<string, string> $dataMap Array of field mappings
       * @param bool $useCamelCaseMapping Flag to enable camelCase conversion
       */
      
      Defined in .../app/Core/Lib/DataMapper/DataMapper.php:32
      public mapField(string $field, string $method): string Map a field name according to the data map and mapping type.
      /**
       * Map a field name according to the data map and mapping type.
       * @param string $field The field name to map
       * @param string $method Either 'get' or 'set' to determine mapping direction
       * @return string The mapped field name
       * @throws DataMapperException If an invalid mapping method is provided
       */
      
      Defined in .../app/Core/Lib/DataMapper/DataMapper.php:45
      public getDataMap(): array Get the current data map.
      /**
       * Get the current data map.
       * @return array<string, string>
       */
      
      Defined in .../app/Core/Lib/DataMapper/DataMapper.php:80
      public setDataMap(array $dataMap): static Set the data map.
      /**
       * Set the data map.
       * @param array<string, string> $dataMap
       * @return $this
       */
      
      Defined in .../app/Core/Lib/DataMapper/DataMapper.php:90
      public getUseCamelCaseMapping(): bool Check if camelCase mapping is enabled.
      /**
       * Check if camelCase mapping is enabled.
       * @return bool
       */
      
      Defined in .../app/Core/Lib/DataMapper/DataMapper.php:100
      public setUseCamelCaseMapping(bool $useCamelCaseMapping): static Enable or disable camelCase mapping.
      /**
       * Enable or disable camelCase mapping.
       * @param bool $useCamelCaseMapping
       * @return $this
       */
      
      Defined in .../app/Core/Lib/DataMapper/DataMapper.php:110
  • public __construct(App\Core\Lib\DataCaster\DataCaster $dataCaster, App\Core\Lib\DataMapper\DataMapper $dataMapper) DataConverter constructor.
    new \App\Core\Lib\DataConverter\DataConverter()
    /**
     * DataConverter constructor.
     * @param DataCaster $dataCaster
     * @param DataMapper $dataMapper
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:29
    public useCasts(): bool Determines if any casts are defined.
    $dataConverter->useCasts()
    /**
     * Determines if any casts are defined.
     * @return bool True if casting rules exist.
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:39
    public useDataMapping(): bool Determines if data mapping is enabled.
    $dataConverter->useDataMapping()
    /**
     * Determines if data mapping is enabled.
     * @return bool True if mapping rules exist or camelCase mapping is active.
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:48
    public fromDataSource(array $data): array Converts raw data from a data source to a mapped and casted array.
    $dataConverter->fromDataSource()
    /**
     * Converts raw data from a data source to a mapped and casted array.
     * @param array<string,mixed> $data Raw data.
     * @return array<string,mixed> Converted data array.
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:58
    public toDataSource(array $data): array Converts data for storage into a data source, applying mapping and casting.
    $dataConverter->toDataSource()
    /**
     * Converts data for storage into a data source, applying mapping and casting.
     * @param array<string,mixed> $data
     * @return array<string,mixed>
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:75
    public createClassObject(string $className, array $row): object Creates an instance of a class and populates it with converted data.
    $dataConverter->createClassObject()
    /**
     * Creates an instance of a class and populates it with converted data.
     * @param string $className Fully qualified class name.
     * @param array<string,mixed> $row Raw data to populate the object.
     * @return object
     * @throws DataConverterException If the class does not exist.
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:93
    protected castData(array $data, string $method): array Casts an array of data according to the DataCaster rules.
    /**
     * Casts an array of data according to the DataCaster rules.
     * @param array<string,mixed> $data
     * @param 'get'|'set' $method
     * @return array<string,mixed>
     * @throws DataConverterException
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:113
    protected mapData(array $data, string $method): array Maps array keys according to DataMapper rules.
    /**
     * Maps array keys according to DataMapper rules.
     * @param array<string,mixed> $data
     * @param 'get'|'set' $method
     * @return array<string,mixed>
     * @throws DataConverterException
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:133
    public getDataCaster(): App\Core\Lib\DataCaster\DataCaster Get the DataCaster instance.
    $dataConverter->getDataCaster()
    /**
     * Get the DataCaster instance.
     * @return DataCaster
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:152
    public getDataMapper(): App\Core\Lib\DataMapper\DataMapper Get the DataMapper instance.
    $dataConverter->getDataMapper()
    /**
     * Get the DataMapper instance.
     * @return DataMapper
     */
    
    Defined in .../app/Core/Lib/DataConverter/DataConverter.php:161