예제 #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;
 }
 /**
  * @return \Google_Service_Datastore_Key
  */
 public function getKey()
 {
     return $this->keyBuilder->build();
 }