Example #1
0
 /**
  * @param \Google_Service_Datastore_Key|\Google_Service_Datastore_KeyPathElement|Path\Builder|Builder $parentKey_or_parentPath
  * @return $this
  * @throws ParameterException
  */
 public function withParent($parentKey_or_parentPath)
 {
     if ($parentKey_or_parentPath instanceof Builder) {
         $this->parent = $parentKey_or_parentPath->getPath();
     } else {
         if ($parentKey_or_parentPath instanceof Path\Builder) {
             $this->parent = $parentKey_or_parentPath->build();
         } else {
             if ($parentKey_or_parentPath instanceof \Google_Service_Datastore_Key) {
                 $this->parent = $parentKey_or_parentPath->getPath();
             } else {
                 if ($parentKey_or_parentPath instanceof \Google_Service_Datastore_KeyPathElement) {
                     $this->parent = $parentKey_or_parentPath;
                 } else {
                     throw new ParameterException(__METHOD__, [\Google_Service_Datastore_Key::class, \Google_Service_Datastore_KeyPathElement::class, Path\Builder::class, Builder::class]);
                 }
             }
         }
     }
     return $this;
 }
 /**
  * @param string $namespace
  */
 public function setNamespace($namespace)
 {
     $this->keyBuilder->withNamespace($namespace);
 }