/**
  * Set the current content to retrieve customized wording texts
  * @param Content $content The content
  */
 public function SetContent(Content $content)
 {
     $this->texts = array();
     $wordings = ContentWording::Schema()->FetchByContent(false, $content);
     foreach ($wordings as $wording) {
         $prefix = String::Replace('-', '.', $content->GetType());
         $this->texts[$prefix . '.' . $wording->GetPlaceholder()] = $wording->GetText();
     }
 }
Beispiel #2
0
 /**
  * Finds the wording with the given placeholder name
  * @param string $name The placeholder name
  * @return ContentWording Gets the matching content wording
  */
 private function FindWording($name)
 {
     if (!$this->Content()->Exists()) {
         return null;
     }
     $sql = Access::SqlBuilder();
     $tblWording = ContentWording::Schema()->Table();
     $where = $sql->Equals($tblWording->Field('Content'), $sql->Value($this->Content()->GetID()))->And_($sql->Equals($tblWording->Field('Placeholder'), $sql->Value($name)));
     return ContentWording::Schema()->First($where);
 }