protected function addOne(ObjectModel $other, $unique = true) { $parentParse = $this->parentObject->getParseObject(); $count = count($parentParse->{$this->keyName}); if ($unique) { $this->parentObject->addUnique($this->keyName, [$other->getParseObject()]); } else { $this->parentObject->add($this->keyName, [$other->getParseObject()]); } if ($count < count($parentParse->{$this->keyName})) { $this->childrenQueue[] = $other; $this->collection[] = $other; } }
public static function __callStatic($method, array $params) { if (in_array($method, self::$parseUserStaticMethods)) { return new static(call_user_func_array(ParseUser::class . '::' . $method, $params)); } return parent::__callStatic($method, $params); }
/** * Relate other object to this object. * * @param ObjectModel $model The child object * @return ObjectModel */ public function save(ObjectModel $model) { $model->{$this->foreignKey} = $this->parentObject; $model->save(); return $model; }