basket_imex-10.x-dev/src/Plugin/IMEX/field/IsDelete.php

src/Plugin/IMEX/field/IsDelete.php
<?php

namespace Drupal\basket_imex\Plugin\IMEX\field;

use Drupal\basket_imex\Plugins\IMEXfield\BasketIMEXfieldInterface;

/**
 * IsDelete IMEX type.
 *
 * @BasketIMEXfield(
 *   id = "is_delete",
 *   type = {"basket_imex_is_delete"},
 *   name = "Delete mark",
 *   type_info = "(int)<br/>1 / 0",
 * )
 */
class IsDelete implements BasketIMEXfieldInterface {

  /**
   * Getting data for export.
   *
   * @param object $entity
   *   Entity that has been updated.
   * @param string $fieldName
   *   Field that has been updated.
   */
  public function getValues($entity, $fieldName) {}

  /**
   * Data array formation.
   *
   * @param object $entity
   *   Entity that has been updated.
   * @param string $importValue
   *   Import value.
   */
  public function setValues($entity, $importValue = '') {
    return !empty(trim($importValue)) ? 1 : 0;
  }

  /**
   * Additional field processing after $entity update / creation.
   *
   * @param object $entity
   *   Entity that has been updated.
   * @param string $importValue
   *   Import value.
   */
  public function postSave($entity, $importValue = '') {}

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc