Skip to content

Commit f996d1b

Browse files
author
ONGR Team
committed
Initial code dump
0 parents  commit f996d1b

File tree

238 files changed

+24035
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+24035
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.idea
2+
.DS_Store
3+
/vendor/
4+
/Tests/app/cache/
5+
/Tests/app/logs/
6+
/Tests/app/build/
7+
/composer.lock
8+
/phpunit.xml

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: php
2+
php:
3+
- 5.4
4+
- 5.5
5+
- 5.6
6+
services:
7+
- elasticsearch
8+
install:
9+
- "echo 'script.disable_dynamic: false' | sudo tee -a /etc/elasticsearch/elasticsearch.yml"
10+
- sudo service elasticsearch restart
11+
before_script:
12+
- composer install
13+
script:
14+
- vendor/bin/phpunit --coverage-text
15+
- vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/,Tests/app/ ./

Annotation/Document.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ONGR package.
5+
*
6+
* (c) NFQ Technologies UAB <info@nfq.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace ONGR\ElasticsearchBundle\Annotation;
13+
14+
/**
15+
* Annotation to mark a class as an Elasticsearch document.
16+
*
17+
* @Annotation
18+
* @Target("CLASS")
19+
*/
20+
final class Document
21+
{
22+
/**
23+
* @var string
24+
*/
25+
public $type;
26+
27+
/**
28+
* @var string
29+
*/
30+
public $parent;
31+
32+
/**
33+
* @var array
34+
*/
35+
public $ttl;
36+
}

Annotation/MultiField.php

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ONGR package.
5+
*
6+
* (c) NFQ Technologies UAB <info@nfq.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace ONGR\ElasticsearchBundle\Annotation;
13+
14+
/**
15+
* Annotation that can be used to define multi-field parameters.
16+
*
17+
* @Annotation
18+
* @Target("ANNOTATION")
19+
*/
20+
final class MultiField
21+
{
22+
/**
23+
* @var string
24+
*
25+
* @Required
26+
*/
27+
public $name;
28+
29+
/**
30+
* @var string
31+
*
32+
* @Required
33+
*/
34+
public $type;
35+
36+
/**
37+
* @var string
38+
*/
39+
public $index;
40+
41+
/**
42+
* @var string
43+
*/
44+
public $analyzer;
45+
46+
/**
47+
* @var string
48+
*/
49+
public $index_analyzer;
50+
51+
/**
52+
* @var string
53+
*/
54+
public $search_analyzer;
55+
56+
/**
57+
* Filters object values.
58+
*
59+
* @return array
60+
*/
61+
public function filter()
62+
{
63+
return array_diff_key(
64+
array_filter(get_object_vars($this)),
65+
array_flip(['name'])
66+
);
67+
}
68+
}

Annotation/Nested.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ONGR package.
5+
*
6+
* (c) NFQ Technologies UAB <info@nfq.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace ONGR\ElasticsearchBundle\Annotation;
13+
14+
/**
15+
* Annotation to mark a class as a nested type during the parsing process.
16+
*
17+
* @Annotation
18+
* @Target("CLASS")
19+
*/
20+
final class Nested
21+
{
22+
}

Annotation/Object.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ONGR package.
5+
*
6+
* (c) NFQ Technologies UAB <info@nfq.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace ONGR\ElasticsearchBundle\Annotation;
13+
14+
/**
15+
* Annotation to mark a class as an object during the parsing process.
16+
*
17+
* @Annotation
18+
* @Target("CLASS")
19+
*/
20+
final class Object
21+
{
22+
}

Annotation/Property.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the ONGR package.
5+
*
6+
* (c) NFQ Technologies UAB <info@nfq.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace ONGR\ElasticsearchBundle\Annotation;
13+
14+
/**
15+
* Annotation used to check mapping type during the parsing process.
16+
*
17+
* @Annotation
18+
* @Target("PROPERTY")
19+
*/
20+
final class Property
21+
{
22+
/**
23+
* @var string
24+
*
25+
* @Required
26+
*/
27+
public $name;
28+
29+
/**
30+
* @var string
31+
*
32+
* @Required
33+
*/
34+
public $type;
35+
36+
/**
37+
* @var string
38+
*/
39+
public $index;
40+
41+
/**
42+
* @var string
43+
*/
44+
public $analyzer;
45+
46+
/**
47+
* @var string
48+
*/
49+
public $index_analyzer;
50+
51+
/**
52+
* @var string
53+
*/
54+
public $search_analyzer;
55+
56+
/**
57+
* @var float
58+
*/
59+
public $boost;
60+
61+
/**
62+
* @var bool
63+
*/
64+
public $payloads;
65+
66+
/**
67+
* @var array<\ONGR\ElasticsearchBundle\Annotation\MultiField>
68+
*/
69+
public $fields;
70+
71+
/**
72+
* Object name to map.
73+
*
74+
* @var string
75+
*/
76+
public $objectName;
77+
78+
/**
79+
* Filters object null values and name.
80+
*
81+
* @return array
82+
*/
83+
public function filter()
84+
{
85+
return array_diff_key(
86+
array_filter(get_object_vars($this)),
87+
array_flip(['name', 'objectName'])
88+
);
89+
}
90+
}

0 commit comments

Comments
 (0)