You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
richdocuments/lib/op.php

41 lines
892 B
PHP

<?php
namespace OCA\Office;
class Op {
public static function add($op){
$query = \OCP\DB::prepare('INSERT INTO `*PREFIX*office_op` (`es_id`, `member`, `opspec`) VALUES (?, ?, ?) ');
$query->execute(array(
$result = $op['es_id'],
$op['member'],
$op['opspec'],
));
if ($result){
return \OCP\DB::insertid(`*PREFIX*office_op`);
}
return 0;
}
public static function getHeadSeq($esId){
$query = \OCP\DB::prepare('SELECT `seq` FROM `*PREFIX*office_op` WHERE `es_id`=? ORDER BY `seq` DESC LIMIT 1');
$result = $query->execute(array(
$esId
))
->fetchOne()
;
return $result;
}
public static function getOpsAfter($esId, $seq){
$query = \OCP\DB::prepare('SELECT `seq` FROM `*PREFIX*office_op` WHERE `es_id`=? AND `seq`>? ORDER BY `seq` ASC');
$result = $query->execute(array(
$esId, $seq
))
->fetchAll()
;
return $result;
}
}