@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | public function properties() {
|
| 17 | 17 | $properties = array(); |
| 18 | 18 | |
| 19 | - foreach($this->properties as $key => $value) {
|
|
| 20 | - if (!in_array($key, $this->ignore)){
|
|
| 19 | + foreach ($this->properties as $key => $value) {
|
|
| 20 | + if (!in_array($key, $this->ignore)) {
|
|
| 21 | 21 | $properties[$key] = $value; |
| 22 | 22 | } |
| 23 | 23 | } |
@@ -56,42 +56,42 @@ discard block |
||
| 56 | 56 | return array_key_exists($key, $this->properties); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - public static function search($component,$class='\Ext\Base',$property=null,$propertyValue=null,$findFirst = false){
|
|
| 59 | + public static function search($component, $class = '\Ext\Base', $property = null, $propertyValue = null, $findFirst = false) {
|
|
| 60 | 60 | $return = []; |
| 61 | - if(is_a($component, $class) and ($property==null or ($property!=null and $component->getProperty($property)==$propertyValue))){
|
|
| 62 | - if($findFirst){
|
|
| 61 | + if (is_a($component, $class) and ($property==null or ($property!=null and $component->getProperty($property)==$propertyValue))) {
|
|
| 62 | + if ($findFirst) {
|
|
| 63 | 63 | return $component; |
| 64 | - }else{
|
|
| 64 | + }else {
|
|
| 65 | 65 | $return[] = $component; |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if($foundComponents = static::searchArray($component->properties(),$class,$property,$propertyValue,$findFirst)){
|
|
| 70 | - if($findFirst){
|
|
| 69 | + if ($foundComponents = static::searchArray($component->properties(), $class, $property, $propertyValue, $findFirst)) {
|
|
| 70 | + if ($findFirst) {
|
|
| 71 | 71 | return $foundComponents; |
| 72 | - }else{
|
|
| 73 | - $return = array_merge($return,$foundComponents); |
|
| 72 | + }else {
|
|
| 73 | + $return = array_merge($return, $foundComponents); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | } |
| 77 | 77 | return $return; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - protected static function searchArray($array,$class='\Ext\Base',$property=null,$propertyValue='',$findFirst = false){
|
|
| 80 | + protected static function searchArray($array, $class = '\Ext\Base', $property = null, $propertyValue = '', $findFirst = false) {
|
|
| 81 | 81 | $return = []; |
| 82 | - foreach($array as $element){
|
|
| 82 | + foreach ($array as $element) {
|
|
| 83 | 83 | $foundComponent = null; |
| 84 | - if($element instanceof SerializableObject){
|
|
| 85 | - $foundComponent = static::search($element,$class,$property,$propertyValue,$findFirst); |
|
| 86 | - }elseif(is_array($element)){
|
|
| 87 | - $foundComponent = static::searchArray($element,$class,$property,$propertyValue,$findFirst); |
|
| 84 | + if ($element instanceof SerializableObject) {
|
|
| 85 | + $foundComponent = static::search($element, $class, $property, $propertyValue, $findFirst); |
|
| 86 | + }elseif (is_array($element)) {
|
|
| 87 | + $foundComponent = static::searchArray($element, $class, $property, $propertyValue, $findFirst); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if($foundComponent) {
|
|
| 90 | + if ($foundComponent) {
|
|
| 91 | 91 | if ($findFirst) {
|
| 92 | 92 | $return = $foundComponent; |
| 93 | 93 | break; |
| 94 | - } else {
|
|
| 94 | + }else {
|
|
| 95 | 95 | $return = array_merge($return, $foundComponent); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | * @param $bool |
| 13 | 13 | * @return $this |
| 14 | 14 | */ |
| 15 | - public function setRemoteFilter($bool){
|
|
| 16 | - return $this->setProperty('remoteFilter',(bool)$bool);
|
|
| 15 | + public function setRemoteFilter($bool) {
|
|
| 16 | + return $this->setProperty('remoteFilter', (bool)$bool);
|
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | * @param $bool |
| 22 | 22 | * @return $this |
| 23 | 23 | */ |
| 24 | - public function setRemoteSort($bool){
|
|
| 25 | - return $this->setProperty('remoteSort',(bool)$bool);
|
|
| 24 | + public function setRemoteSort($bool) {
|
|
| 25 | + return $this->setProperty('remoteSort', (bool)$bool);
|
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | * @param $storeId |
| 32 | 32 | * @return $this |
| 33 | 33 | */ |
| 34 | - public function setStoreId($storeId){
|
|
| 35 | - return $this->setProperty('storeId',$storeId);
|
|
| 34 | + public function setStoreId($storeId) {
|
|
| 35 | + return $this->setProperty('storeId', $storeId);
|
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function getStoreId(){
|
|
| 38 | + public function getStoreId() {
|
|
| 39 | 39 | return $this->getProperty('storeId');
|
| 40 | 40 | } |
| 41 | 41 | |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | * @param $pageSize |
| 46 | 46 | * @return $this |
| 47 | 47 | */ |
| 48 | - public function setPageSize($pageSize){
|
|
| 49 | - return $this->setProperty('pageSize',$pageSize);
|
|
| 48 | + public function setPageSize($pageSize) {
|
|
| 49 | + return $this->setProperty('pageSize', $pageSize);
|
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - public function getPageSize(){
|
|
| 52 | + public function getPageSize() {
|
|
| 53 | 53 | return $this->getProperty('pageSize');
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | \ No newline at end of file |
@@ -5,8 +5,8 @@ |
||
| 5 | 5 | class Store extends ProxyStore |
| 6 | 6 | {
|
| 7 | 7 | |
| 8 | - public function setData(array $data){
|
|
| 9 | - return $this->setProperty('data',$data);
|
|
| 8 | + public function setData(array $data) {
|
|
| 9 | + return $this->setProperty('data', $data);
|
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | } |
| 13 | 13 | \ No newline at end of file |
@@ -14,19 +14,19 @@ |
||
| 14 | 14 | class Reader extends Base |
| 15 | 15 | {
|
| 16 | 16 | |
| 17 | - public function setRootProperty($rootProperty){
|
|
| 18 | - return $this->setProperty('rootProperty',$rootProperty);
|
|
| 17 | + public function setRootProperty($rootProperty) {
|
|
| 18 | + return $this->setProperty('rootProperty', $rootProperty);
|
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function getRootProperty(){
|
|
| 21 | + public function getRootProperty() {
|
|
| 22 | 22 | return $this->getProperty('rootProperty');
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function setTotalProperty($totalProperty){
|
|
| 26 | - return $this->setProperty('totalProperty',$totalProperty);
|
|
| 25 | + public function setTotalProperty($totalProperty) {
|
|
| 26 | + return $this->setProperty('totalProperty', $totalProperty);
|
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function getTotalProperty(){
|
|
| 29 | + public function getTotalProperty() {
|
|
| 30 | 30 | return $this->getProperty('totalProperty');
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | \ No newline at end of file |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | |
| 12 | 12 | class Json extends Reader |
| 13 | 13 | {
|
| 14 | - public function setMetadataProperty($metadataProperty){
|
|
| 15 | - return $this->setProperty('metadataProperty',$metadataProperty);
|
|
| 14 | + public function setMetadataProperty($metadataProperty) {
|
|
| 15 | + return $this->setProperty('metadataProperty', $metadataProperty);
|
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - public function getMetadataProperty(){
|
|
| 18 | + public function getMetadataProperty() {
|
|
| 19 | 19 | return $this->getProperty('metadataProperty');
|
| 20 | 20 | } |
| 21 | 21 | |
@@ -8,34 +8,34 @@ |
||
| 8 | 8 | class ProxyStore extends AbstractStore |
| 9 | 9 | {
|
| 10 | 10 | |
| 11 | - public function addField(Field $field){
|
|
| 12 | - return $this->add('fields',$field);
|
|
| 11 | + public function addField(Field $field) {
|
|
| 12 | + return $this->add('fields', $field);
|
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - public function setFields(array $fields){
|
|
| 16 | - foreach($fields as $field){
|
|
| 15 | + public function setFields(array $fields) {
|
|
| 16 | + foreach ($fields as $field) {
|
|
| 17 | 17 | $this->addField($field); |
| 18 | 18 | } |
| 19 | 19 | return $this; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - public function setAutoLoad($autoLoad){
|
|
| 23 | - return $this->setProperty('autoLoad',$autoLoad);
|
|
| 22 | + public function setAutoLoad($autoLoad) {
|
|
| 23 | + return $this->setProperty('autoLoad', $autoLoad);
|
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public function setProxy($proxy){
|
|
| 27 | - return $this->setProperty('proxy',$proxy);
|
|
| 26 | + public function setProxy($proxy) {
|
|
| 27 | + return $this->setProperty('proxy', $proxy);
|
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function getProxy(){
|
|
| 30 | + public function getProxy() {
|
|
| 31 | 31 | return $this->getProperty('proxy');
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public function setModel($model){
|
|
| 35 | - return $this->setProperty('model',$model);
|
|
| 34 | + public function setModel($model) {
|
|
| 35 | + return $this->setProperty('model', $model);
|
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function getModel(){
|
|
| 38 | + public function getModel() {
|
|
| 39 | 39 | return $this->getProperty('model');
|
| 40 | 40 | } |
| 41 | 41 | |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | class Field extends Base |
| 8 | 8 | {
|
| 9 | 9 | |
| 10 | - public function setName($name){
|
|
| 11 | - $this->setProperty('name',$name);
|
|
| 10 | + public function setName($name) {
|
|
| 11 | + $this->setProperty('name', $name);
|
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | } |
| 15 | 15 | \ No newline at end of file |
@@ -7,11 +7,11 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Proxy extends Base |
| 9 | 9 | {
|
| 10 | - public function setReader(Reader $reader){
|
|
| 11 | - return $this->setProperty('reader',$reader);
|
|
| 10 | + public function setReader(Reader $reader) {
|
|
| 11 | + return $this->setProperty('reader', $reader);
|
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - public function getReader(){
|
|
| 14 | + public function getReader() {
|
|
| 15 | 15 | return $this->getProperty('reader');
|
| 16 | 16 | } |
| 17 | 17 | |
@@ -4,20 +4,20 @@ |
||
| 4 | 4 | |
| 5 | 5 | abstract class Server extends Proxy |
| 6 | 6 | {
|
| 7 | - public function setIdParam($idParam){
|
|
| 8 | - return $this->setProperty('idParam',$idParam);
|
|
| 7 | + public function setIdParam($idParam) {
|
|
| 8 | + return $this->setProperty('idParam', $idParam);
|
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | - public function getIdParam(){
|
|
| 11 | + public function getIdParam() {
|
|
| 12 | 12 | return $this->getProperty('idParam');
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | - public function setUrl($url){
|
|
| 17 | - return $this->setProperty('url',$url);
|
|
| 16 | + public function setUrl($url) {
|
|
| 17 | + return $this->setProperty('url', $url);
|
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function getUrl(){
|
|
| 20 | + public function getUrl() {
|
|
| 21 | 21 | return $this->getProperty('url');
|
| 22 | 22 | } |
| 23 | 23 | |