2121 * @method float getY()
2222 * @method float getHeight()
2323 * @method float getWidth()
24- * @method float[] getVector()
25- * @method setVector(array $vector)
2624 * @method setX(float $x)
2725 * @method setY(float $y)
2826 * @method setHeight(float $height)
2927 * @method setWidth(float $width)
3028 * @method setClusterId(int|null $clusterId)
3129 * @method int|null getClusterId()
3230 * @method float getThreshold()
33- * @method setThreshold(float $threshold)
31+ * @method setThreshold(float $threshold)
3432 */
3533class FaceDetection extends Entity {
3634 protected $ fileId ;
@@ -39,17 +37,17 @@ class FaceDetection extends Entity {
3937 protected $ y ;
4038 protected $ height ;
4139 protected $ width ;
42- protected $ vector ;
40+ protected $ faceVector ;
4341 protected $ clusterId ;
4442 protected $ threshold ;
4543 /**
4644 * @var string[]
4745 */
48- public static $ columns = ['id ' , 'user_id ' , 'file_id ' , 'x ' , 'y ' , 'height ' , 'width ' , 'vector ' , 'cluster_id ' , 'threshold ' ];
46+ public static $ columns = ['id ' , 'user_id ' , 'file_id ' , 'x ' , 'y ' , 'height ' , 'width ' , 'face_vector ' , 'cluster_id ' , 'threshold ' ];
4947 /**
5048 * @var string[]
5149 */
52- public static $ fields = ['id ' , 'userId ' , 'fileId ' , 'x ' , 'y ' , 'height ' , 'width ' , 'vector ' , 'clusterId ' , 'threshold ' ];
50+ public static $ fields = ['id ' , 'userId ' , 'fileId ' , 'x ' , 'y ' , 'height ' , 'width ' , 'faceVector ' , 'clusterId ' , 'threshold ' ];
5351
5452 public function __construct () {
5553 // add types in constructor
@@ -60,19 +58,26 @@ public function __construct() {
6058 $ this ->addType ('y ' , 'float ' );
6159 $ this ->addType ('height ' , 'float ' );
6260 $ this ->addType ('width ' , 'float ' );
63- $ this ->addType ('vector ' , 'json ' );
61+ $ this ->addType ('faceVector ' , 'json ' );
6462 $ this ->addType ('clusterId ' , 'integer ' );
6563 $ this ->addType ('threshold ' , 'float ' );
6664 }
6765
6866 public function toArray (): array {
6967 $ array = [];
7068 foreach (static ::$ fields as $ field ) {
71- if ($ field === 'vector ' ) {
69+ if ($ field === 'faceVector ' ) {
7270 continue ;
7371 }
7472 $ array [$ field ] = $ this ->{$ field };
7573 }
7674 return $ array ;
7775 }
76+
77+ public function getVector (): array {
78+ return $ this ->getter ('faceVector ' );
79+ }
80+ public function setVector (array $ vector ): void {
81+ $ this ->setter ('faceVector ' , [$ vector ]);
82+ }
7883}
0 commit comments