Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Drupal\Core\Field\Plugin\Field\FieldType; /** * Defines the 'created' e..

Decoded Output download

<?php

namespace Drupal\Core\Field\Plugin\Field\FieldType;

/**
 * Defines the 'created' entity field type.
 *
 * @FieldType(
 *   id = "created",
 *   label = @Translation("Created"),
 *   description = @Translation("An entity field containing a UNIX timestamp of when the entity has been created."),
 *   no_ui = TRUE,
 *   default_widget = "datetime_timestamp",
 *   default_formatter = "timestamp"
 * )
 */
class CreatedItem extends TimestampItem {

  /**
   * {@inheritdoc}
   */
  public function applyDefaultValue($notify = TRUE) {
    parent::applyDefaultValue($notify);
    // Created fields default to the current timestamp.
    $this->setValue(['value' => REQUEST_TIME], $notify);
    return $this;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Drupal\Core\Field\Plugin\Field\FieldType;

/**
 * Defines the 'created' entity field type.
 *
 * @FieldType(
 *   id = "created",
 *   label = @Translation("Created"),
 *   description = @Translation("An entity field containing a UNIX timestamp of when the entity has been created."),
 *   no_ui = TRUE,
 *   default_widget = "datetime_timestamp",
 *   default_formatter = "timestamp"
 * )
 */
class CreatedItem extends TimestampItem {

  /**
   * {@inheritdoc}
   */
  public function applyDefaultValue($notify = TRUE) {
    parent::applyDefaultValue($notify);
    // Created fields default to the current timestamp.
    $this->setValue(['value' => REQUEST_TIME], $notify);
    return $this;
  }

}

Function Calls

None

Variables

None

Stats

MD5 8910e355ccec0c167a551e228e8448d7
Eval Count 0
Decode Time 110 ms