public function save(Default_Model_VOWideImageListImage $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getVowideImageListID())) {
         $data['vowide_image_list_id'] = $value->getVowideImageListID();
     }
     if (!isnull($value->getVappListID())) {
         $data['vapplistid'] = $value->getVappListID();
     }
     if (!isnull($value->getGuid())) {
         $data['guid'] = $value->getGuid();
     }
     if (!isnull($value->getState())) {
         $data['state'] = $value->getState();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #2
0
 public function save(Default_Model_AppDelInfo $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getAppID())) {
         $data['appid'] = $value->getAppID();
     }
     if (!isnull($value->getDeletedBy())) {
         $data['deletedby'] = $value->getDeletedBy();
     }
     if (!isnull($value->getDeletedOn())) {
         $data['deletedon'] = $value->getDeletedOn();
     }
     if (!isnull($value->getRoleID())) {
         $data['roleid'] = $value->getRoleID();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #3
0
 public function save(Repository_Model_CommRepoOs $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getDisplayName())) {
         $data['displayName'] = $value->getDisplayName();
     }
     if (!isnull($value->getFlavor())) {
         $data['flavor'] = $value->getFlavor();
     }
     if (!isnull($value->getDisplayFlavor())) {
         $data['displayFlavor'] = $value->getDisplayFlavor();
     }
     if (!isnull($value->getArtifactType())) {
         $data['artifactType'] = $value->getArtifactType();
     }
     if (!isnull($value->getAcronym())) {
         $data['acronym'] = $value->getAcronym();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #4
0
 public function save(Default_Model_Message $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getReceiverID())) {
         $data['receiverid'] = $value->getReceiverID();
     }
     if (!isnull($value->getSenderID())) {
         $data['senderid'] = $value->getSenderID();
     }
     if (!isnull($value->getMsg())) {
         $data['msg'] = $value->getMsg();
     }
     if (!isnull($value->getSentOn())) {
         $data['senton'] = $value->getSentOn();
     }
     if (!isnull($value->getIsRead())) {
         $data['isread'] = $this->pgBool($value->getIsRead());
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #5
0
 public function save(Default_Model_AppTag $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getAppID())) {
         $data['appid'] = $value->getAppID();
     }
     if (!isnull($value->getResearcherID())) {
         $data['researcherid'] = $value->getResearcherID();
     }
     if (!isnull($value->getTag())) {
         $data['tag'] = $value->getTag();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #6
0
 public function save(Default_Model_Actor $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getID())) {
         $data['id'] = $value->getID();
     }
     if (!isnull($value->getGUID())) {
         $data['guid'] = $value->getGUID();
     }
     if (!isnull($value->getType())) {
         $data['type'] = $value->getType();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getCName())) {
         $data['cname'] = $value->getCName();
     }
     if (!isnull($value->getHidden())) {
         $data['hidden'] = $this->pgBool($value->getHidden());
     }
     $q1 = '';
     $q2 = '';
     if (null === ($id = '')) {
         unset($data['']);
         $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
 public function save(Default_Model_AccessTokenNetfilter $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getNetfilter())) {
         $data['netfilter'] = $value->getNetfilter();
     }
     if (!isnull($value->getTokenID())) {
         $data['tokenid'] = $value->getTokenID();
     }
     $q1 = array('tokenid = ?', 'netfilter = ?');
     $q2 = array($value->tokenid, $value->netfilter);
     $select = $this->getDbTable()->select();
     for ($i = 0; $i < count($q1); $i++) {
         $select->where($q1[$i], $q2[$i]);
     }
     $new_entry = count($this->getDbTable()->fetchAll($select)) == 0;
     if ($new_entry) {
         $this->getDbTable()->insert($data);
     } else {
         $s = array();
         for ($i = 0; $i < count($q1); $i++) {
             $s[] = $this->getDbTable()->getAdapter()->quoteInto($q1[$i], $q2[$i]);
         }
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #8
0
 public function save(Default_Model_Permission $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getActorGUID())) {
         $data['actor'] = $value->getActorGUID();
     }
     if (!isnull($value->getActionID())) {
         $data['actionid'] = $value->getActionID();
     }
     if (!isnull($value->getTargetGUID())) {
         $data['object'] = $value->getTargetGUID();
     }
     $q1 = '';
     $q2 = '';
     if (null === ($id = '')) {
         unset($data['']);
         $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
 public function save(Default_Model_ResearcherCname $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getCreated())) {
         $data['created'] = $value->getCreated();
     }
     if (!isnull($value->getEnabled())) {
         $data['enabled'] = $this->pgBool($value->getEnabled());
     }
     if (!isnull($value->getIsprimary())) {
         $data['isprimary'] = $this->pgBool($value->getIsprimary());
     }
     if (!isnull($value->getValue())) {
         $data['value'] = $value->getValue();
     }
     if (!isnull($value->getResearcherID())) {
         $data['researcherid'] = $value->getResearcherID();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #10
0
 public function save(Default_Model_ContractType $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getTitle())) {
         $data['title'] = $value->getTitle();
     }
     if (!isnull($value->getGroupName())) {
         $data['groupname'] = $value->getGroupName();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #11
0
 public function save(Default_Model_AccessToken $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getToken())) {
         $data['token'] = $value->getToken();
     }
     if (!isnull($value->getActorid())) {
         $data['actor'] = $value->getActorid();
     }
     if (!isnull($value->getCreatedOn())) {
         $data['createdon'] = $value->getCreatedOn();
     }
     if (!isnull($value->getType())) {
         $data['type'] = $value->getType();
     }
     if (!isnull($value->getAddedByID())) {
         $data['addedby'] = $value->getAddedByID();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #12
0
 public function save(Default_Model_VA $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getAppID())) {
         $data['appid'] = $value->getAppID();
     }
     if (!isnull($value->getImgLstPrivate())) {
         $data['imglst_private'] = $this->pgBool($value->getImgLstPrivate());
     }
     if (!isnull($value->getGuID())) {
         $data['guid'] = $value->getGuID();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #13
0
 public function save(Default_Model_NGI $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getDescription())) {
         $data['description'] = $value->getDescription();
     }
     if (!isnull($value->getCountryID())) {
         $data['countryid'] = $value->getCountryID();
     }
     if (!isnull($value->getUrl())) {
         $data['url'] = $value->getUrl();
     }
     if (!isnull($value->getEuropean())) {
         $data['european'] = $this->pgBool($value->getEuropean());
     }
     if (!isnull($value->getLogo())) {
         $data['logo'] = $value->getLogo();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
 public function save(Default_Model_ActorGroupMember $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getGroupID())) {
         $data['groupid'] = $value->getGroupID();
     }
     if (!isnull($value->getActorGUID())) {
         $data['actorid'] = $value->getActorGUID();
     }
     if (!isnull($value->getPayload())) {
         $data['payload'] = $value->getPayload();
     }
     $q1 = '';
     $q2 = '';
     if (null === ($id = $value->id)) {
         unset($data['']);
         $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #15
0
 public function save(Default_Model_Privilege $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getActionID())) {
         $data['actionid'] = $value->getActionID();
     }
     if (!isnull($value->getObject())) {
         $data['object'] = $value->getObject();
     }
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getActor())) {
         $data['actor'] = $value->getActor();
     }
     if (!isnull($value->getRevoked())) {
         $data['revoked'] = $this->pgBool($value->getRevoked());
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #16
0
 public function save(Default_Model_VOContact $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getVoID())) {
         $data['void'] = $value->getVoID();
     }
     if (!isnull($value->getResearcherID())) {
         $data['researcherid'] = $value->getResearcherID();
     }
     if (!isnull($value->getRole())) {
         $data['role'] = $value->getRole();
     }
     if (!isnull($value->getEmail())) {
         $data['email'] = $value->getEmail();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     $q1 = '';
     $q2 = '';
     if (null === ($id = '')) {
         unset($data['']);
         $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #17
0
 public function save(Default_Model_DisseminationEntry $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getComposerID())) {
         $data['composerid'] = $value->getComposerID();
     }
     if (!isnull($value->getRecipients())) {
         $data['recipients'] = $value->getRecipients();
     }
     if (!isnull($value->getFilter())) {
         $data['filter'] = $value->getFilter();
     }
     if (!isnull($value->getSubject())) {
         $data['subject'] = $value->getSubject();
     }
     if (!isnull($value->getMessage())) {
         $data['message'] = $value->getMessage();
     }
     if (!isnull($value->getSentOn())) {
         $data['senton'] = $value->getSentOn();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
 public function save(Repository_Model_CommRepoAllowedPlatformCombination $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getOsId())) {
         $data['osId'] = $value->getOsId();
     }
     if (!isnull($value->getArchId())) {
         $data['archId'] = $value->getArchId();
     }
     if (!isnull($value->getCanSupport())) {
         $data['canSupport'] = $value->getCanSupport();
     }
     if (!isnull($value->getFsPattern())) {
         $data['fsPattern'] = $value->getFsPattern();
     }
     if (!isnull($value->getIncRelSupport())) {
         $data['incRelSupport'] = $value->getIncRelSupport();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #19
0
 public function save(Default_Model_New $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getTimestamp())) {
         $data['timestamp'] = $value->getTimestamp();
     }
     if (!isnull($value->getAction())) {
         $data['action'] = $value->getAction();
     }
     if (!isnull($value->getSubjectguid())) {
         $data['subjectguid'] = $value->getSubjectguid();
     }
     if (!isnull($value->getFields())) {
         $data['fields'] = $value->getFields();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #20
0
 public function save($value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getVmiID())) {
         $data['vmiid'] = $value->getVmiID();
     }
     if (!isnull($value->getHypervisors())) {
         $data['hypervisors'] = $value->getHypervisors();
     }
     if (!isnull($value->getArchID())) {
         $data['archid'] = $value->getArchID();
     }
     if (!isnull($value->getOsID())) {
         $data['osid'] = $value->getOsID();
     }
     if (!isnull($value->getOsVersion())) {
         $data['osversion'] = $value->getOsVersion();
     }
     if (!isnull($value->getFormat())) {
         $data['format'] = $value->getFormat();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #21
0
 public function save(Default_Model_AppCountry $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getContinent())) {
         $data['continent'] = $this->pgBool($value->getContinent());
     }
     if (!isnull($value->getISOcode())) {
         $data['isocode'] = $value->getISOcode();
     }
     if (!isnull($value->getRegionID())) {
         $data['regionid'] = $value->getRegionID();
     }
     if (!isnull($value->getAppID())) {
         $data['appid'] = $value->getAppID();
     }
     if (!isnull($value->getInherited())) {
         $data['inherited'] = $this->pgBool($value->getInherited());
     }
     $q1 = '';
     $q2 = '';
     if (null === ($id = '')) {
         unset($data['']);
         $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
 public function save(Default_Model_DisciplineInfo $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getDisciplineID())) {
         $data['disciplineid'] = $value->getDisciplineID();
     }
     if (!isnull($value->getType())) {
         $data['type'] = $value->getType();
     }
     if (!isnull($value->getData())) {
         $data['data'] = $value->getData();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #23
0
 public function save(Default_Model_VMI $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getDescription())) {
         $data['description'] = $value->getDescription();
     }
     if (!isnull($value->getGuID())) {
         $data['guid'] = $value->getGuID();
     }
     if (!isnull($value->getVappID())) {
         $data['vappid'] = $value->getVappID();
     }
     if (!isnull($value->getNotes())) {
         $data['notes'] = $value->getNotes();
     }
     if (!isnull($value->getGroupname())) {
         $data['groupname'] = $value->getGroupname();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #24
0
 public function save(Default_Model_Category $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getName())) {
         $data['name'] = $value->getName();
     }
     if (!isnull($value->getOrd())) {
         $data['ord'] = $value->getOrd();
     }
     if (!isnull($value->getParentID())) {
         $data['parentid'] = $value->getParentID();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #25
0
 public function save(Default_Model_Author $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getDocID())) {
         $data['docid'] = $value->getDocID();
     }
     if (!isnull($value->getAuthorID())) {
         $data['authorid'] = $value->getAuthorID();
     }
     if (!isnull($value->getFullName())) {
         $data['fullname'] = $value->getFullName();
     }
     if (!isnull($value->getMain())) {
         $data['main'] = $this->pgBool($value->getMain());
     }
     $q1 = '';
     $q2 = '';
     if (null === ($id = '')) {
         unset($data['']);
         $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #26
0
 public function save(Default_Model_AppCategory $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getAppID())) {
         $data['appid'] = $value->getAppID();
     }
     if (!isnull($value->getCategoryID())) {
         $data['categoryid'] = $value->getCategoryID();
     }
     if (!isnull($value->getIsPrimary())) {
         $data['isprimary'] = $this->pgBool($value->getIsPrimary());
     }
     if (!isnull($value->getInherited())) {
         $data['inherited'] = $this->pgBool($value->getInherited());
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #27
0
 public function save(Default_Model_AppOSe $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getAppID())) {
         $data['appid'] = $value->getAppID();
     }
     if (!isnull($value->getOsID())) {
         $data['osid'] = $value->getOsID();
     }
     $q1 = array('appid = ?', 'osid = ?');
     $q2 = array($value->appid, $value->osid);
     $select = $this->getDbTable()->select();
     for ($i = 0; $i < count($q1); $i++) {
         $select->where($q1[$i], $q2[$i]);
     }
     $new_entry = count($this->getDbTable()->fetchAll($select)) == 0;
     if ($new_entry) {
         $this->getDbTable()->insert($data);
     } else {
         $s = array();
         for ($i = 0; $i < count($q1); $i++) {
             $s[] = $this->getDbTable()->getAdapter()->quoteInto($q1[$i], $q2[$i]);
         }
         $this->getDbTable()->update($data, $s);
     }
 }
 public function save(Default_Model_DatasetLicense $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getDatasetID())) {
         $data['datasetid'] = $value->getDatasetID();
     }
     if (!isnull($value->getLicenseID())) {
         $data['licenseid'] = $value->getLicenseID();
     }
     if (!isnull($value->getTitle())) {
         $data['title'] = $value->getTitle();
     }
     if (!isnull($value->getComment())) {
         $data['comment'] = $value->getComment();
     }
     if (!isnull($value->getLink())) {
         $data['link'] = $value->getLink();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }
Пример #29
0
 public static function isViewer($formID, $username = NULL)
 {
     if (isnull($username)) {
         $username = sessionGet("username");
     }
     return self::getCount($formID, $username, mfcs::AUTH_VIEW) || self::isEditor($formID, $username);
 }
 public function save(Default_Model_UserCredential $value)
 {
     global $application;
     $data = array();
     if (!isnull($value->getId())) {
         $data['id'] = $value->getId();
     }
     if (!isnull($value->getResearcherID())) {
         $data['researcherid'] = $value->getResearcherID();
     }
     if (!isnull($value->getSessionID())) {
         $data['sessionid'] = $value->getSessionID();
     }
     if (!isnull($value->getToken())) {
         $data['token'] = $value->getToken();
     }
     if (!isnull($value->getAddedOn())) {
         $data['addedon'] = $value->getAddedOn();
     }
     $q1 = 'id = ?';
     $q2 = $value->id;
     if (null === ($id = $value->id)) {
         unset($data['id']);
         $value->id = $this->getDbTable()->insert($data);
     } else {
         $s = $this->getDbTable()->getAdapter()->quoteInto($q1, $q2);
         $this->getDbTable()->update($data, $s);
     }
 }