Exemplo n.º 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);
 }
Exemplo n.º 2
0
 private function entityContainsComputedValues()
 {
     return count($this->entityInfo->getIgnoredColumns()) > 0;
 }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function ignoredColumnsAreIdentifiedCorrectly()
 {
     $this->assertEquals([], array_diff(['ignored_column', 'other_ignored_column'], array_keys($this->entityInfo->getIgnoredColumns())));
 }