54 private $handlers = array(
'read' => null,
'stats' => null,
'joint' => null,
'write' => null,
'sync' => null);
116 parent::__construct($db);
117 $this->table = $this->db2->prefix(
$table);
136 $this->handler = null;
142 $this->handler = $xmf->loadHandler($this,
$handler, $args,
$path);
193 if (is_object($this->handler) && is_callable(array($this->handler,
$name))) {
194 return call_user_func_array(array($this->handler,
$name), $args);
196 foreach (array_keys($this->handlers) as $_handler) {
220 if (empty($this->className))
return false;
223 $obj =
new $this->className();
224 if ($isNew ===
true) {
238 public function get(
$id = null, $fields = null)
242 $object = $this->
create();
245 $qb = $this->db2->createXoopsQueryBuilder();
247 if (is_array($fields) && count($fields) > 0) {
248 if (!in_array($this->keyName, $fields)) {
252 foreach ($fields as $field) {
257 $qb->addSelect($field);
263 $qb->from($this->table, null)
264 ->where($eb->eq($this->keyName,
':id'))
265 ->setParameter(
':id',
$id, \PDO::PARAM_INT);
266 if (!
$result = $qb->execute()) {
269 $row =
$result->fetch(\PDO::FETCH_ASSOC);
273 $object = $this->
create(
false);
274 $object->assignVars($row);
300 return $handler->insert($object, $force);
315 return $handler->delete($object, $force);
330 if (empty($criteria))
return false;
334 return $handler->deleteAll($criteria, $force, $asObject);
349 if (empty($criteria))
return false;
353 return $handler->updateAll($fieldname, $fieldvalue, $criteria, $force);
getByLink(CriteriaElement $criteria=null, $fields=null, $asObject=true, $field_link=null, $field_object=null)
__construct(Connection $db=null, $table= '', $className= '', $keyName= '', $identifierName= '')
getCount(CriteriaElement $criteria=null)
insert(XoopsObject $object, $force=true)
getCounts(CriteriaElement $criteria=null)
getCountByLink(CriteriaElement $criteria=null)
getCountsByLink(CriteriaElement $criteria=null)
getIds(CriteriaElement $criteria=null)
getObjects(CriteriaElement $criteria=null, $id_as_key=false, $as_object=true)
getList(CriteriaElement $criteria=null, $limit=0, $start=0)
cleanOrphan($table_link= '', $field_link= '', $field_object= '')
synchronization($table_link= '', $field_link= '', $field_object= '')
deleteAll(CriteriaElement $criteria, $force=true, $asObject=false)
setHandler($handler=null, $args=null, $path=null)
deleteByLink(CriteriaElement $criteria=null)
updateAll($fieldname, $fieldvalue, CriteriaElement $criteria, $force=false)
getAll(CriteriaElement $criteria=null, $fields=null, $asObject=true, $id_as_key=true)
updateByLink($data, CriteriaElement $criteria=null)
loadHandler($name, $args=null)