getAttribute() public method

public getAttribute ( integer $id ) : Attribute | null
$id integer
return Attribute | null
Example #1
0
 public function setSprinting($value = true)
 {
     if ($value !== $this->isSprinting()) {
         $this->setDataFlag(self::DATA_FLAGS, self::DATA_FLAG_SPRINTING, (bool) $value);
         $attr = $this->attributeMap->getAttribute(Attribute::MOVEMENT_SPEED);
         $attr->setValue($value ? $attr->getValue() * 1.3 : $attr->getValue() / 1.3);
     }
 }