getFieldValue() public method

constructor
public getFieldValue ( $p_property, $p_forceFetchFromDatabase = false )
 public function serializeToJson(JsonSerializationVisitor $visitor, $data, $type)
 {
     $articleData = new \ArticleData($data->type, $data->number, $data->languageId);
     if (count($articleData->getUserDefinedColumns()) == 0) {
         return null;
     }
     $fields = array();
     foreach ($articleData->getUserDefinedColumns() as $column) {
         $fields[$column->getPrintName()] = $articleData->getFieldValue($column->getPrintName());
     }
     $fields['show_on_front_page'] = $data->onFrontPage == "Y" ? 1 : 0;
     $fields['show_on_section_page'] = $data->onSection == "Y" ? 1 : 0;
     return $fields;
 }
Beispiel #2
0
 public function serialize(VisitorInterface $visitor, $data, $type, &$visited)
 {
     if ($type != 'Newscoop\\Entity\\Article') {
         return;
     }
     $GLOBALS['g_campsiteDir'] = realpath(__DIR__ . '/../../../../../../newscoop/');
     $articleData = new \ArticleData($data->getType(), $data->getNumber(), $data->getLanguageId());
     if (count($articleData->getUserDefinedColumns()) == 0) {
         $data->setFields(null);
         return;
     }
     $fields = array();
     foreach ($articleData->getUserDefinedColumns() as $column) {
         $fields[$column->getPrintName()] = $articleData->getFieldValue($column->getPrintName());
     }
     $data->setFields($fields);
 }
 /**
  * Add field properties to document
  *
  * @param  array $doc
  *
  * @return array
  */
 private function addDataFields(array $doc, $article)
 {
     $articleData = new \ArticleData($article->getType(), $article->getNumber(), $article->getLanguageId());
     if (count($articleData->getUserDefinedColumns()) == 0) {
         return $doc;
     }
     $fields = array();
     foreach ($articleData->getUserDefinedColumns() as $column) {
         $doc[$column->getPrintName()] = $articleData->getFieldValue($column->getPrintName());
     }
     return $doc;
 }