public function __construct($kwargs) { if (!isset($kwargs['rel']) || isset($kwargs['rel']) && $kwargs['rel'] === null) { $kwargs['rel'] = ManyToManyRel::createObject(['fromField' => $this, 'to' => ArrayHelper::getValue($kwargs, 'to'), 'through' => ArrayHelper::getValue($kwargs, 'through'), 'throughFields' => ArrayHelper::getValue($kwargs, 'throughFields'), 'dbConstraint' => ArrayHelper::getValue($kwargs, 'dbConstraint', true)]); } $this->hasNullKwarg = ArrayHelper::hasKey($kwargs, 'null'); parent::__construct($kwargs); }
public function __construct($kwargs) { if (!isset($kwargs['rel']) || isset($kwargs['rel']) && $kwargs['rel'] == null) { $kwargs['rel'] = ManyToOneRel::createObject(['fromField' => $this, 'to' => ArrayHelper::getValue($kwargs, 'to'), 'toField' => ArrayHelper::getValue($kwargs, 'toField'), 'parentLink' => ArrayHelper::getValue($kwargs, 'parentLink'), 'onDelete' => ArrayHelper::getValue($kwargs, 'onDelete', Delete::CASCADE)]); } $this->toField = ArrayHelper::getValue($kwargs, 'toField'); $this->fromField = 'this'; parent::__construct($kwargs); }