Skip to content

Commit b4cd3d5

Browse files
author
Martin Kluska
committed
Added setAttribute method for all options - option can be set at runtime
1 parent 9c99d54 commit b4cd3d5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Traits/BasePositionTrait.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Pion\Support\Eloquent\Position\Traits;
34

45
/**
@@ -121,4 +122,26 @@ protected function resetPositionOptionCache()
121122
}
122123

123124
//endregion
125+
126+
//region Override of attribute set for options
127+
/**
128+
* Enables setting disablePositionUpdate option in runtime
129+
*
130+
* @param boolean $value
131+
*/
132+
public function setDisablePositionUpdateAttribute($value)
133+
{
134+
$this->optionCache['disablePositionUpdate'] = $value;
135+
}
136+
137+
/**
138+
* Enables setting positionColumn option in runtime
139+
*
140+
* @param string $value
141+
*/
142+
public function setPositionColumnAttribute($value)
143+
{
144+
$this->optionCache['positionColumn'] = $value;
145+
}
146+
//endregion
124147
}

0 commit comments

Comments
 (0)