BEdita API doc | 4-cactus
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Download

Namespaces

  • BEdita
    • API
      • Auth
      • Controller
        • Admin
        • Model
      • Exception
      • Middleware
      • Model
        • Action
      • Network
        • Exception
      • Utility
    • Core
      • Database
        • Type
      • Exception
      • Filesystem
        • Adapter
        • Exception
        • Thumbnail
      • Job
        • Service
      • Mailer
        • Preview
        • Transport
      • Model
        • Action
        • Behavior
        • Entity
        • Validation
      • ORM
        • Locator
      • Utility

Classes

  • LocationsValidator
  • MediaValidator
  • ObjectsValidator
  • ObjectTypesValidator
  • ProfilesValidator
  • UsersValidator
  • Validation

Class Validation

Class to provide reusable validation rules. Used for object types and properties.

Namespace: BEdita\Core\Model\Validation
Since: 4.0.0
Located at Core/src/Model/Validation/Validation.php

Methods summary

public static
# clear( )

Clear reserved names list

Clear reserved names list

protected static string[]
# reservedWords( )

Load list of reserved names in $reserved

Load list of reserved names in $reserved

Returns

string[]
public static boolean
# notReserved( mixed $value )

Check if a value is not reserved

Check if a value is not reserved

Parameters

$value
Value to check

Returns

boolean
public static boolean
# requireNull( mixed $value )

Require a value to be null

Require a value to be null

Parameters

$value
Value to check

Returns

boolean
public static boolean
# url( string $value )

Checks that a value is a valid URL or custom url as myapp://

Checks that a value is a valid URL or custom url as myapp://

Parameters

$value
The url to check

Returns

boolean
public static true|string
# jsonSchema( mixed $value, mixed $schema )

Validate using JSON Schema.

Validate using JSON Schema.

Parameters

$value
Value being validated.
$schema
Schema to validate against.

Returns

true|string
public static true|string
# languageTag( string $tag )

Validate language tag using I18n configuration.

Validate language tag using I18n configuration.

Parameters

$tag
Language tag

Returns

true|string
public static true|string
# dateTime( mixed $value )

Validate input date and datetime. Accepetd input formats: - string date format - integer timestamps - DateTime objects

Validate input date and datetime. Accepetd input formats: - string date format - integer timestamps - DateTime objects

Accepted date time string formats are - 2017-01-01 YYYY-MM-DD - 2017-01-01 11:22 YYYY-MM-DD hh:mm - 2017-01-01T11:22:33 YYYY-MM-DDThh:mm:ss - 2017-01-01T11:22:33Z YYYY-MM-DDThh:mm:ssZ - 2017-01-01T19:20+01:00 YYYY-MM-DDThh:mmTZD - 2017-01-01T11:22:33+0100 YYYY-MM-DDThh:mm:ssTZD - 2017-01-01T19:20:30.45+01 YYYY-MM-DDThh:mm:ss.sTZD

See ISO 8601 subset as defined here https://www.w3.org/TR/NOTE-datetime: Valid TZD formats are: ±hh:mm, ±hhmm and ±hh, e.g. +01:00, +0100 and +01

Also timestamp as integer are accepted.

Parameters

$value
Date or datetime value

Returns

true|string

Properties summary

protected static string[]|null $reserved

The list of reserved names

The list of reserved names

# null
BEdita API doc | 4-cactus API documentation generated by ApiGen