DateFormatInterface.php

Same filename in other branches
  1. 8.9.x core/lib/Drupal/Core/Datetime/DateFormatInterface.php
  2. 10 core/lib/Drupal/Core/Datetime/DateFormatInterface.php
  3. 11.x core/lib/Drupal/Core/Datetime/DateFormatInterface.php

Namespace

Drupal\Core\Datetime

File

core/lib/Drupal/Core/Datetime/DateFormatInterface.php

View source
<?php

namespace Drupal\Core\Datetime;

use Drupal\Core\Config\Entity\ConfigEntityInterface;

/**
 * Provides an interface defining a date format.
 */
interface DateFormatInterface extends ConfigEntityInterface {
    
    /**
     * Gets the date pattern string for this format.
     *
     * @return string
     *   The pattern string as expected by date().
     */
    public function getPattern();
    
    /**
     * Sets the date pattern for this format.
     *
     * @param string $pattern
     *   The date pattern to use for this format.
     *
     * @return $this
     */
    public function setPattern($pattern);
    
    /**
     * Determines if this date format is locked.
     *
     * @return bool
     *   TRUE if the date format is locked, FALSE otherwise.
     */
    public function isLocked();

}

Interfaces

Title Deprecated Summary
DateFormatInterface Provides an interface defining a date format.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.