Example #1
0
 /**
  * Add 'parent' and 'children' rels
  *
  * @param  Config $config
  */
 public static function initialize(Config $config)
 {
     $class = $config->getModelClass();
     $config->addRel(new Rel\BelongsTo('parent', $config, $class::getRepo()))->addRel(new Rel\HasMany('children', $config, $class::getRepo(), ['foreignKey' => 'parentId']));
 }