You are here

public function OpignoModuleManagerController::array_unshift_assoc in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/Controller/OpignoModuleManagerController.php \Drupal\opigno_module\Controller\OpignoModuleManagerController::array_unshift_assoc()

Array unshift.

1 call to OpignoModuleManagerController::array_unshift_assoc()
OpignoModuleManagerController::getActivityTypes in src/Controller/OpignoModuleManagerController.php
Get the list of the existing activity types.

File

src/Controller/OpignoModuleManagerController.php, line 633

Class

OpignoModuleManagerController
Controller for all the actions of the Opigno module manager.

Namespace

Drupal\opigno_module\Controller

Code

public function array_unshift_assoc(&$arr, $key, $val) {
  $arr = array_reverse($arr, TRUE);
  $arr[$key] = $val;
  $arr = array_reverse($arr, TRUE);
  return $arr;
}