Example #1
0
function __formenc(Penelope\ObjectSchema $object_schema)
{
    foreach ($object_schema->getProperties() as $property_schema) {
        if (in_array($property_schema->getType(), array('file', 'image'))) {
            __('multipart/form-data');
            return;
        }
    }
    __('application/x-www-form-urlencoded');
}
Example #2
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.');
             }
         }
     }
 }
Example #3
0
 public function __construct(Neo4j\Client $client, $name, $slug, NodeSchema $start_schema, NodeSchema $end_schema, array $properties = null, array $options = null)
 {
     $this->end_schema = $end_schema;
     $this->start_schema = $start_schema;
     parent::__construct($client, $name, $slug, $properties, $options);
 }