7use Bitrix\Main\Entity\ExpressionField;
8use Bitrix\Main\Entity\Query;
17 '=MAILBOX_ID' => $mailboxId,
26 'order' => [
'LEVEL' =>
'ASC']
27 ])->fetchCollection();
35 '=MAILBOX_ID' => $mailboxId,
44 while ($row = $query->fetchObject())
46 $result[$row->getPath()] = $row;
57 '=MAILBOX_ID' => $mailboxId,
62 'order' => [
'LEVEL' =>
'ASC']
67 while ($row = $query->fetchObject())
69 $result[$row->getPath()] = $row;
79 '=MAILBOX_ID' => $mailboxId,
89 '=MAILBOX_ID' => $mailboxId,
100 '=MAILBOX_ID' => $mailboxId,
111 while ($row = $query->fetch())
113 $result[] = $row[
'DIR_MD5'];
132 '=MAILBOX_ID' => $mailboxId,
151 $connection = $entity->getConnection();
154 'UPDATE %s SET %s WHERE %s',
155 $connection->getSqlHelper()->quote($entity->getDbTableName()),
156 $connection->getSqlHelper()->prepareUpdate($entity->getDbTableName(), [
159 Query::buildFilterSql(
162 'MAILBOX_ID' => $mailboxId,
168 return $connection->query($query);
171 public static function update($id, $data)
176 public static function add(array $data)
181 public static function addMulti($rows, $ignoreEvents =
false)
189 $connection = $entity->getConnection();
191 return $connection->query(sprintf(
192 'DELETE FROM %s WHERE %s',
193 $connection->getSqlHelper()->quote($entity->getDbTableName()),
194 Query::buildFilterSql($entity, $filter)
201 $connection = $entity->getConnection();
203 return $connection->query(sprintf(
204 "UPDATE %s SET %s WHERE %s",
205 $connection->getSqlHelper()->quote($entity->getDbTableName()),
206 $connection->getSqlHelper()->prepareUpdate($entity->getDbTableName(), [
209 Query::buildFilterSql(
212 '=MAILBOX_ID' => $mailboxId,
213 '@DIR_MD5' => $values,
224 '=MAILBOX_ID' => $mailboxId
232 'order' => [
'LEVEL' =>
'ASC']
237 while ($row = $query->fetchObject())
239 $result[$row->getPath()] = $row;
249 '=MAILBOX_ID' => $mailboxId,
254 'order' => [
'LEVEL' =>
'ASC']
255 ])->fetchCollection();
262 '=MAILBOX_ID' => $mailboxId,
266 'order' => [
'ID' =>
'ASC']
267 ])->fetchCollection();
274 '=MAILBOX_ID' => $mailboxId,
284 return (
int)$counter[
'CNT'];
291 '=MAILBOX_ID' => $mailboxId,
294 'select' => [
'MIN_SYNC_TIME'],
296 new ExpressionField(
'MIN_SYNC_TIME',
'MIN(COALESCE(%s, 0))',
'SYNC_TIME'),
300 return (
int)$res[
'MIN_SYNC_TIME'];
307 '=MAILBOX_ID' => $mailboxId,
317 return (
int)$counter[
'CNT'];
325 'MESSAGE_COUNT' => $val
353 $connection = $entity->getConnection();
356 "UPDATE %s SET %s WHERE %s",
357 $connection->getSqlHelper()->quote($entity->getDbTableName()),
358 $connection->getSqlHelper()->prepareUpdate($entity->getDbTableName(), [
359 'SYNC_LOCK' => $time,
361 Query::buildFilterSql(
367 '=SYNC_LOCK' =>
'IS NULL',
374 $connection->query($query);
375 $count = $connection->getAffectedRowsCount();
static fetchOneOutcome($mailboxId)
static fetchAllLevelByParentId($mailboxId, $path, $level)
static getMinSyncTime($mailboxId)
static deleteList(array $filter)
static fetchTrashAndSpamHash($mailboxId)
static updateSync($id, $val)
static fetchOneByHash($mailboxId, $hash)
static resetDirsTypes($mailboxId, $type)
static updateMessageCount($id, $val)
static fetchAll($mailboxId)
static updateFlags($id, $flags)
static addMulti($rows, $ignoreEvents=false)
static fetchAllDisabledDirs($mailboxId)
static countMessagesSyncDirs($mailboxId)
static fetchAllSyncDirs($mailboxId)
static fetchOneLevelByParentId($mailboxId, $id, $level)
static fetchAllDirsTypes($mailboxId)
static updateSyncDirs(array $values, $val, $mailboxId)
static setSyncLock(int $id, int $time)
static countSyncDirs($mailboxId)
static updateSyncTime($id, $val)
static update($id, $data)
static fetchOneByMailboxIdAndHash($mailboxId, $hash)
static getList(array $parameters=array())
static addMulti($rows, $ignoreEvents=false)
static update($primary, array $data)