Source of file Common.php
Size: 2,319 Bytes - Last Modified: 2022-02-21T10:01:54+00:00
/var/www/docs.ssmods.com/process/src/src/Common.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 | <?php namespace AntonyThorpe\Knockout; trait Common { /** * $observable * * @var string A Knockout observable */ protected $observable; /** * $otherBindings * * @var string For additional items in the data-bind attribute */ protected $otherBindings; /** * $hasFocus * * @var boolean For applying focus to a field */ protected $hasFocus = false; /** * setObservable * * @param string $name The name of the knockout observable * @return $this */ public function setObservable($name) { $this->observable = trim($name); return $this; } /** * getObservable * * @return string The observable used with the binding handler */ public function getObservable() { return $this->observable; } /** * setbindingType * * @param string $key As per http://knockoutjs.com/documentation/introduction.htmlentities * (e.g 'value', 'textInput', 'checked', 'options', 'selectedOptions') * @return $this */ public function setBindingType($key) { $this->bindingType = $key; return $this; } /** * getBindingType * * @return string Provide the Knockoutjs binding type used on the element */ public function getBindingType() { return $this->bindingType; } /** * getOtherBindings * * @return string The other bindings used on the element */ public function getOtherBindings() { return $this->otherBindings; } /** * setOtherBindings * * @param string $otherbindings Additional value for the data-bind attribute * @return $this */ public function setOtherBindings($otherbindings) { $this->otherBindings = trim($otherbindings); return $this; } /** * setHasFocus * * @param boolean $input set the element to a focus state upon page load * @return $this */ public function setHasFocus($input) { $this->hasFocus = (boolean)$input; return $this; } /** * getHasFocus * * @return boolean */ public function getHasFocus() { return $this->hasFocus; } } |