Example #1
0
 public function __construct(ObjectSchema $object_schema, $id = null, Neo4j\PropertyContainer $client_object = null)
 {
     $this->schema = $object_schema;
     $this->client = $object_schema->getClient();
     if ($client_object) {
         if ($client_object->getId() !== $id) {
             throw new \InvalidArgumentException('IDs do not match.');
         }
         $this->client_object = $client_object;
         $this->id = $id;
     } else {
         if (is_int($id) or ctype_digit($id)) {
             $this->id = (int) $id;
         } else {
             if ($id) {
                 throw new \InvalidArgumentException('Invalid ID.');
             }
         }
     }
 }