Skip to content

Commit

Permalink
ignore null entities
Browse files Browse the repository at this point in the history
  • Loading branch information
ychadwick committed Mar 8, 2016
1 parent 20c4bf7 commit 5124af7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Exporter/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ public function createCsv(EntityMap $entityMap, $results)
$row = array();
/** @var FieldMap|TranslatableFieldMap $field */
foreach ($entityMap->getFields() as $field) {

if ($field->hasJoinFields()) {
$joinEntity = $this->accessor->getValue($entity, $field->getPropertyPath());

Expand Down Expand Up @@ -555,11 +556,10 @@ protected function addAdditionalExport(FieldMap $field)
}

/**
* @param $row
* @param bool|false $header
* @param $row
* @return int|void
*/
protected function addRowToFile($row, $header = false)
protected function addRowToFile($row)
{
return fputcsv($this->fileHandle, $row, self::XML_DELIMITER, self::XML_ENCLOSURE);
}
Expand All @@ -571,6 +571,9 @@ protected function addRowToFile($row, $header = false)
*/
public function getColumnData($entity, $propertyPath)
{
if(!$entity){
return null;
}
return $this->accessor->getValue($entity, $propertyPath);
}

Expand Down

0 comments on commit 5124af7

Please sign in to comment.