Ejemplo n.º 1
0
 /** @test */
 public function it_can_set_and_get_the_value_key()
 {
     $value = new Value();
     $value->setValueKey('foobar');
     $this->assertEquals('foobar', $value->getValueKey());
 }
Ejemplo n.º 2
0
 /**
  * Updates an EAV "value" object with the given value.
  *
  * @param  \Cartalyst\Attributes\Value  $valueInstance
  * @param  mixed  $value
  * @return \Cartalyst\Attributes\Value|bool
  */
 protected function updateEavValue(Value $valueInstance, $value)
 {
     if (!$value) {
         $valueInstance->delete();
         return;
     }
     $valueInstance->setValueKey($value);
     if ($valueInstance->save()) {
         return $valueInstance;
     }
 }