This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\views_first_page\Plugin\views\Pager; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\views\Plugin\views\pager\Full; | |
/** | |
* @ViewsPager( | |
* id = "variable_pager", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_cron(). | |
*/ | |
function orx_saved_searches_cron() { | |
$query = <<<EOF | |
SELECT id, view_path FROM {saved_search} | |
WHERE (last_executed IS NULL OR last_queued < last_executed) | |
AND last_queued + notification_interval <= :request_time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$link_element = [ | |
'#type' => 'link', | |
'#title' => [ | |
'#prefix' => '<i class="fa fa-home">', | |
'#markup' => $this->t('Home'), | |
'#suffix' => '</i>', | |
], | |
'#url' => $url, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\node\Entity\Node; | |
// node 1 has 'field_ref', which is a multi-valued field currently referencing nodes 2 and 3. | |
$node = Node::load(1); | |
$node->field_ref[] = 4; | |
$node->save(); // 'field_ref' now contains [2,3,4]. |