Example #1
0
 /**
  * True / false if the entity should be saved / ignored. Works as a filtering method.
  *
  * @param array $data
  * @return bool
  */
 public function shouldBeSaved($data)
 {
     $shouldBeSaved = true;
     if ($this->entityInfo->isIgnoredEntity($data)) {
         $shouldBeSaved = false;
     }
     if ($this->ignoreFrequentlyWrittenEntities) {
         $isFrequentlyWrittenEntity = $this->entityInfo->isFrequentlyWrittenEntity($data);
         $shouldBeSaved = $shouldBeSaved && !$isFrequentlyWrittenEntity;
     }
     $entityName = $this->entityInfo->entityName;
     return apply_filters("vp_entity_should_be_saved_{$entityName}", $shouldBeSaved, $data, $this);
 }
 private function entityContainsComputedValues()
 {
     return count($this->entityInfo->getIgnoredColumns()) > 0;
 }
 /**
  * @test
  */
 public function ignoredColumnsAreIdentifiedCorrectly()
 {
     $this->assertEquals([], array_diff(['ignored_column', 'other_ignored_column'], array_keys($this->entityInfo->getIgnoredColumns())));
 }