Пример #1
0
 public function duplicate($newPA = false)
 {
     $db = Loader::db();
     $newPA = parent::duplicate($newPA);
     $r = $db->Execute('select * from ' . $this->dbTableAccessList . ' where paID = ?', array($this->getPermissionAccessID()));
     while ($row = $r->FetchRow()) {
         $v = array($row['peID'], $newPA->getPermissionAccessID(), $row['permission']);
         $db->Execute('insert into ' . $this->dbTableAccessList . ' (peID, paID, permission) values (?, ?, ?)', $v);
     }
     $r = $db->Execute('select * from ' . $this->dbTableAccessListCustom . ' where paID = ?', array($this->getPermissionAccessID()));
     while ($row = $r->FetchRow()) {
         $v = array($row['peID'], $newPA->getPermissionAccessID(), $row['gID']);
         $db->Execute('insert into ' . $this->dbTableAccessListCustom . ' (peID, paID, gID) values (?, ?, ?)', $v);
     }
     return $newPA;
 }