/** * Intercepts all reading property accesses and return corresponding Mockster instance * * @param string $name * @return Mockster * @throws \ReflectionException */ public function __get($name) { if (!array_key_exists($name, $this->propertyMocksters)) { if (!$this->properties->has($name)) { throw new \ReflectionException("The property [{$this->class}::{$name}] does not exist"); } if ($this->uuts) { $mockster = $this->properties[$name]->get($this->uuts[0])->__mockster; } else { $mockster = new Mockster($this->getTypeHint($name), $this->factory); } $this->propertyMocksters[$name] = $mockster; } return $this->propertyMocksters[$name]; }
/** * (PHP 5 >= 5.0.0)<br/> * Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind() { $this->objIterator->rewind(); }
public function selectProperties($names) { $this->properties = $this->properties->select(new Set($names)); return $this; }
/** * Delete entity values. * * @throws \InvalidArgumentException */ public function delete() { if (!in_array(SoftDeletes::class, class_uses_recursive(get_class($this->entity)), true) || $this->entity->forceDeleting) { $instance = new Value(); $connection = $this->entity->getConnection(); $connection->table($instance->getTable())->where('entity_id', $this->entity->getKey())->whereIn('property_id', $this->properties->pluck('id'))->delete(); } }