2022-04-05 16:46:11 +00:00
|
|
|
<?php
|
2022-05-23 14:54:50 +00:00
|
|
|
|
2022-04-05 16:46:11 +00:00
|
|
|
namespace Appwrite\Utopia\Database\Validator;
|
|
|
|
|
|
|
|
|
|
use Utopia\Database\Document;
|
|
|
|
|
use Utopia\Database\Validator\Queries as ValidatorQueries;
|
|
|
|
|
|
|
|
|
|
class Queries extends ValidatorQueries
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Expression constructor
|
|
|
|
|
*
|
|
|
|
|
* @param Document[] $attributes
|
|
|
|
|
* @param Document[] $indexes
|
|
|
|
|
* @param bool $strict
|
|
|
|
|
*/
|
|
|
|
|
public function __construct($attributes, $indexes, $strict)
|
|
|
|
|
{
|
|
|
|
|
// Remove failed/stuck/processing indexes
|
2022-05-23 14:54:50 +00:00
|
|
|
$indexes = \array_filter($indexes, function ($index) {
|
2022-04-05 16:46:11 +00:00
|
|
|
return $index->getAttribute('status') === 'available';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
parent::__construct($attributes, $indexes, $strict);
|
|
|
|
|
}
|
2022-05-23 14:54:50 +00:00
|
|
|
}
|