Skip to content

Commit

Permalink
phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 22, 2015
1 parent 2f34a53 commit aa5ffa0
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions dev/skeletons/skeleton_class.class.php
Expand Up @@ -43,7 +43,7 @@ class Skeleton_Class extends CommonObject
var $table_element='skeleton'; //!< Name of table without prefix where object is stored

var $lines=array();

var $id;
var $prop1;
var $prop2;
Expand Down Expand Up @@ -106,23 +106,18 @@ function create($user, $notrigger=0)
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// want this action to call a trigger.

//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//if ($result < 0) $error++;
//// End call triggers
}
}

// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
Expand Down Expand Up @@ -197,7 +192,7 @@ function fetchAll($sortorder, $sortfield, $limit, $offset, $filter = array())
$sql.= " t.field2";
//...
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";

// Manage filter
$sqlwhere=array();
if (count($filter)>0) {
Expand All @@ -211,26 +206,26 @@ function fetchAll($sortorder, $sortfield, $limit, $offset, $filter = array())
$sql .= " ORDER BY " . $sortfield . " " . $sortorder . " " . $this->db->plimit($limit + 1, $offset);

$this->lines = array ();

dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);

while ($obj = $this->db->fetch_object($resql))
{
$line=new Skeleton_ClassLine();

$line->id = $obj->rowid;
$line->prop1 = $obj->field1;
$line->prop2 = $obj->field2;

$this->line[]=$line;
//...
}
$this->db->free($resql);

return $num;
}
else
Expand Down Expand Up @@ -435,7 +430,8 @@ function initAsSpecimen()

}

class Skeleton_ClassLine {
class Skeleton_ClassLine
{
var $id;
var $prop1;
var $prop2;
Expand Down

0 comments on commit aa5ffa0

Please sign in to comment.