/** * Delete all documents * * @return null */ private static function _deleteAll() { if (self::$user) { self::$user->deleteElastic(); } foreach (ElasticUser::all() as $obj) { if ($obj) { $obj->deleteElastic(); } } ElasticUser::refreshElastic(); }
<?php class ElasticUser extends User { use TORM\ElasticSearch; } ElasticUser::setTableName("users"); ElasticUser::setElasticSearchIndex("torm");