normalizeMap() public static méthode

Takes either a flat array of relationships or a nested key=>value array and returns it as a nested format
public static normalizeMap ( $array ) : array
Résultat array
Exemple #1
0
 /**
  * Eager load relationships to avoid the N+1 problem
  * @chainable
  */
 public function includes($rels)
 {
     foreach (Relationship::normalizeMap($rels) as $alias => $nested) {
         $this->_includes[$alias] = new Relationships\Includer($this->_query, $this->_schema->relationship($alias), $nested);
     }
     return $this;
 }