Skip to content

Instantly share code, notes, and snippets.

@heddn
Created March 1, 2018 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heddn/ed6936bb56731d284b6abe12635c9836 to your computer and use it in GitHub Desktop.
Save heddn/ed6936bb56731d284b6abe12635c9836 to your computer and use it in GitHub Desktop.
class Nodes extends SqlBase {
/**
* {@inheritdoc}
*/
public function query() {
$query = $this->select('node', 'n')
->fields('n', ['nid']);
// Add the value for the custom id.
$query->addExpression(':now', 'current__date', [':now' => date('Ymd')]);
return $query;
}
/**
* {@inheritdoc}
*/
public function getIds() {
return [
'nid' => [
'type' => 'string',
],
'current__date' => [
'type' => 'string',
'max_length' => '10',
],
];
}
@heddn
Copy link
Author

heddn commented Mar 1, 2018

You must use the above plugin with ignore_map configured on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment