Fixtures::create_classes PHP Method

create_classes() public method

public create_classes ( )
    function create_classes()
    {
        $classes = array('Address' => '{"city": {"propertyType": "STRING"}}', 'Country' => null, 'City' => null, 'Profile' => '{ "name": {"propertyType": "STRING"} , "followers": {"propertyType": "LINKMAP","linkedClass": "Profile"} }', 'Company' => null, 'Comment' => null, 'Post' => '{"comments": {"propertyType": "LINKLIST","linkedClass": "Comment"}}', 'MapPoint' => '{"x": {"propertyType": "FLOAT"}, "y":{"propertyType": "FLOAT"} }');
        foreach ($classes as $class => $properties) {
            $query = "CREATE CLASS " . $class;
            $result = $this->client->post('/command/' . $this->dbname . '/sql/' . $query, $this->contentType)->send()->json();
            $this->{$class} = $result['result'][0]['value'];
            if ($properties) {
                $this->client->post(sprintf("/property/%s/%s", $this->dbname, $class), $this->contentType, $properties)->send();
            }
        }
        return $this;
    }