Exemplo n.º 1
0
 /**
  * Saves the given News.
  *
  * @param News $News
  */
 public function saveNews(News $News)
 {
     if ($News->getAppKey() === '') {
         $News->setAppKey($this->getContext());
     }
     $this->ORM->saveObject($News);
 }
Exemplo n.º 2
0
 /**
  * Saves the new / edited guestbook entry.
  *
  * @param Entry $entry The guestbook entry to save.
  *
  * @author Christian Achatz
  * @version
  * Version 0.1, 10.05.2009<br />
  */
 public function saveEntry(Entry $entry)
 {
     $genericEntry = $this->mapDomainObject2GenericEntry($entry);
     $this->orm->saveObject($genericEntry);
 }
Exemplo n.º 3
0
 *
 * Please note, that you may have to adapt the include path for the <em>bootstrap.php</em>.
 */
use APF\modules\genericormapper\data\GenericDomainObject;
use APF\modules\genericormapper\data\GenericORRelationMapper;
$orm = new GenericORRelationMapper();
$orm->setContext($context);
$orm->addMappingConfiguration('APF\\modules\\guestbook2009\\data', 'guestbook2009');
$orm->addRelationConfiguration('APF\\modules\\guestbook2009\\data', 'guestbook2009');
$orm->setConnectionName($connectionKey);
$orm->setup();
// --- setup available languages ----------------------------------------------------------------
$langDe = new GenericDomainObject('Language');
$langDe->setProperty('ISOCode', 'de');
$langDe->setProperty('DisplayName', 'Deutsch');
$langDeId = $orm->saveObject($langDe);
$langDe->setProperty('LanguageID', $langDeId);
$langEn = new GenericDomainObject('Language');
$langEn->setProperty('ISOCode', 'en');
$langEn->setProperty('DisplayName', 'English');
$langEnId = $orm->saveObject($langEn);
$langEn->setProperty('LanguageID', $langEnId);
// --- create one guestbook instance ------------------------------------------------------------
$guestbook = new GenericDomainObject('Guestbook');
// --- create admin account ---------------------------------------------------------------------
$user = new GenericDomainObject('User');
$user->setProperty('Username', 'admin');
$user->setProperty('Password', md5('admin'));
$user->setProperty('Name', 'Admin');
$user->setProperty('Email', 'root@localhost');
$userId = $orm->saveObject($user);
Exemplo n.º 4
0
 /**
  * Adds the given RecipientList to the postbox and saves everything.
  *
  * @param RecipientList $RecipientList
  *
  * @return Postbox Returns itself.
  */
 public function addRecipientList(RecipientList $RecipientList)
 {
     $this->User->addRelatedObject('User2RecipientList', $RecipientList);
     $this->ORM->saveObject($this->User, true);
     return $this;
 }