@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | -require_once (dirname(dirname(__FILE__)) . '/blendmigrations.class.php'); |
|
| 2 | +require_once (dirname(dirname(__FILE__)).'/blendmigrations.class.php'); |
|
| 3 | 3 | class BlendMigrations_mysql extends BlendMigrations {} |
| 4 | 4 | \ No newline at end of file |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $xpdo_meta_map['BlendMigrations']= array ( |
| 3 | - 'package' => 'blend', |
|
| 4 | - 'version' => '1.1', |
|
| 5 | - 'table' => 'blend_migrations', |
|
| 6 | - 'extends' => 'xPDOSimpleObject', |
|
| 7 | - 'fields' => |
|
| 8 | - array ( |
|
| 3 | + 'package' => 'blend', |
|
| 4 | + 'version' => '1.1', |
|
| 5 | + 'table' => 'blend_migrations', |
|
| 6 | + 'extends' => 'xPDOSimpleObject', |
|
| 7 | + 'fields' => |
|
| 8 | + array ( |
|
| 9 | 9 | 'name' => NULL, |
| 10 | 10 | 'version' => NULL, |
| 11 | 11 | 'type' => 'master', |
@@ -14,64 +14,64 @@ discard block |
||
| 14 | 14 | 'author' => NULL, |
| 15 | 15 | 'created_at' => 'CURRENT_TIMESTAMP', |
| 16 | 16 | 'processed_at' => NULL, |
| 17 | - ), |
|
| 18 | - 'fieldMeta' => |
|
| 19 | - array ( |
|
| 17 | + ), |
|
| 18 | + 'fieldMeta' => |
|
| 19 | + array ( |
|
| 20 | 20 | 'name' => |
| 21 | 21 | array ( |
| 22 | - 'dbtype' => 'varchar', |
|
| 23 | - 'precision' => '255', |
|
| 24 | - 'phptype' => 'string', |
|
| 25 | - 'null' => false, |
|
| 22 | + 'dbtype' => 'varchar', |
|
| 23 | + 'precision' => '255', |
|
| 24 | + 'phptype' => 'string', |
|
| 25 | + 'null' => false, |
|
| 26 | 26 | ), |
| 27 | 27 | 'version' => |
| 28 | 28 | array ( |
| 29 | - 'dbtype' => 'varchar', |
|
| 30 | - 'precision' => '32', |
|
| 31 | - 'phptype' => 'string', |
|
| 32 | - 'null' => true, |
|
| 29 | + 'dbtype' => 'varchar', |
|
| 30 | + 'precision' => '32', |
|
| 31 | + 'phptype' => 'string', |
|
| 32 | + 'null' => true, |
|
| 33 | 33 | ), |
| 34 | 34 | 'type' => |
| 35 | 35 | array ( |
| 36 | - 'dbtype' => 'set', |
|
| 37 | - 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
|
| 38 | - 'phptype' => 'string', |
|
| 39 | - 'null' => false, |
|
| 40 | - 'default' => 'master', |
|
| 36 | + 'dbtype' => 'set', |
|
| 37 | + 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
|
| 38 | + 'phptype' => 'string', |
|
| 39 | + 'null' => false, |
|
| 40 | + 'default' => 'master', |
|
| 41 | 41 | ), |
| 42 | 42 | 'description' => |
| 43 | 43 | array ( |
| 44 | - 'dbtype' => 'text', |
|
| 45 | - 'phptype' => 'string', |
|
| 46 | - 'null' => true, |
|
| 44 | + 'dbtype' => 'text', |
|
| 45 | + 'phptype' => 'string', |
|
| 46 | + 'null' => true, |
|
| 47 | 47 | ), |
| 48 | 48 | 'status' => |
| 49 | 49 | array ( |
| 50 | - 'dbtype' => 'varchar', |
|
| 51 | - 'precision' => '16', |
|
| 52 | - 'phptype' => 'string', |
|
| 53 | - 'null' => false, |
|
| 54 | - 'default' => 'ready', |
|
| 50 | + 'dbtype' => 'varchar', |
|
| 51 | + 'precision' => '16', |
|
| 52 | + 'phptype' => 'string', |
|
| 53 | + 'null' => false, |
|
| 54 | + 'default' => 'ready', |
|
| 55 | 55 | ), |
| 56 | 56 | 'author' => |
| 57 | 57 | array ( |
| 58 | - 'dbtype' => 'varchar', |
|
| 59 | - 'precision' => '255', |
|
| 60 | - 'phptype' => 'string', |
|
| 61 | - 'null' => true, |
|
| 58 | + 'dbtype' => 'varchar', |
|
| 59 | + 'precision' => '255', |
|
| 60 | + 'phptype' => 'string', |
|
| 61 | + 'null' => true, |
|
| 62 | 62 | ), |
| 63 | 63 | 'created_at' => |
| 64 | 64 | array ( |
| 65 | - 'dbtype' => 'timestamp', |
|
| 66 | - 'phptype' => 'timestamp', |
|
| 67 | - 'null' => false, |
|
| 68 | - 'default' => 'CURRENT_TIMESTAMP', |
|
| 65 | + 'dbtype' => 'timestamp', |
|
| 66 | + 'phptype' => 'timestamp', |
|
| 67 | + 'null' => false, |
|
| 68 | + 'default' => 'CURRENT_TIMESTAMP', |
|
| 69 | 69 | ), |
| 70 | 70 | 'processed_at' => |
| 71 | 71 | array ( |
| 72 | - 'dbtype' => 'timestamp', |
|
| 73 | - 'phptype' => 'timestamp', |
|
| 74 | - 'null' => true, |
|
| 72 | + 'dbtype' => 'timestamp', |
|
| 73 | + 'phptype' => 'timestamp', |
|
| 74 | + 'null' => true, |
|
| 75 | + ), |
|
| 75 | 76 | ), |
| 76 | - ), |
|
| 77 | 77 | ); |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -$xpdo_meta_map['BlendMigrations']= array ( |
|
| 2 | +$xpdo_meta_map['BlendMigrations'] = array( |
|
| 3 | 3 | 'package' => 'blend', |
| 4 | 4 | 'version' => '1.1', |
| 5 | 5 | 'table' => 'blend_migrations', |
| 6 | 6 | 'extends' => 'xPDOSimpleObject', |
| 7 | 7 | 'fields' => |
| 8 | - array ( |
|
| 8 | + array( |
|
| 9 | 9 | 'name' => NULL, |
| 10 | 10 | 'version' => NULL, |
| 11 | 11 | 'type' => 'master', |
@@ -16,23 +16,23 @@ discard block |
||
| 16 | 16 | 'processed_at' => NULL, |
| 17 | 17 | ), |
| 18 | 18 | 'fieldMeta' => |
| 19 | - array ( |
|
| 19 | + array( |
|
| 20 | 20 | 'name' => |
| 21 | - array ( |
|
| 21 | + array( |
|
| 22 | 22 | 'dbtype' => 'varchar', |
| 23 | 23 | 'precision' => '255', |
| 24 | 24 | 'phptype' => 'string', |
| 25 | 25 | 'null' => false, |
| 26 | 26 | ), |
| 27 | 27 | 'version' => |
| 28 | - array ( |
|
| 28 | + array( |
|
| 29 | 29 | 'dbtype' => 'varchar', |
| 30 | 30 | 'precision' => '32', |
| 31 | 31 | 'phptype' => 'string', |
| 32 | 32 | 'null' => true, |
| 33 | 33 | ), |
| 34 | 34 | 'type' => |
| 35 | - array ( |
|
| 35 | + array( |
|
| 36 | 36 | 'dbtype' => 'set', |
| 37 | 37 | 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
| 38 | 38 | 'phptype' => 'string', |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | 'default' => 'master', |
| 41 | 41 | ), |
| 42 | 42 | 'description' => |
| 43 | - array ( |
|
| 43 | + array( |
|
| 44 | 44 | 'dbtype' => 'text', |
| 45 | 45 | 'phptype' => 'string', |
| 46 | 46 | 'null' => true, |
| 47 | 47 | ), |
| 48 | 48 | 'status' => |
| 49 | - array ( |
|
| 49 | + array( |
|
| 50 | 50 | 'dbtype' => 'varchar', |
| 51 | 51 | 'precision' => '16', |
| 52 | 52 | 'phptype' => 'string', |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | 'default' => 'ready', |
| 55 | 55 | ), |
| 56 | 56 | 'author' => |
| 57 | - array ( |
|
| 57 | + array( |
|
| 58 | 58 | 'dbtype' => 'varchar', |
| 59 | 59 | 'precision' => '255', |
| 60 | 60 | 'phptype' => 'string', |
| 61 | 61 | 'null' => true, |
| 62 | 62 | ), |
| 63 | 63 | 'created_at' => |
| 64 | - array ( |
|
| 64 | + array( |
|
| 65 | 65 | 'dbtype' => 'timestamp', |
| 66 | 66 | 'phptype' => 'timestamp', |
| 67 | 67 | 'null' => false, |
| 68 | 68 | 'default' => 'CURRENT_TIMESTAMP', |
| 69 | 69 | ), |
| 70 | 70 | 'processed_at' => |
| 71 | - array ( |
|
| 71 | + array( |
|
| 72 | 72 | 'dbtype' => 'timestamp', |
| 73 | 73 | 'phptype' => 'timestamp', |
| 74 | 74 | 'null' => true, |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $xpdo_meta_map = array ( |
| 4 | - 'xPDOSimpleObject' => |
|
| 5 | - array ( |
|
| 4 | + 'xPDOSimpleObject' => |
|
| 5 | + array ( |
|
| 6 | 6 | 0 => 'BlendMigrations', |
| 7 | - ), |
|
| 7 | + ), |
|
| 8 | 8 | ); |
| 9 | 9 | \ No newline at end of file |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$xpdo_meta_map = array ( |
|
| 3 | +$xpdo_meta_map = array( |
|
| 4 | 4 | 'xPDOSimpleObject' => |
| 5 | - array ( |
|
| 5 | + array( |
|
| 6 | 6 | 0 => 'BlendMigrations', |
| 7 | 7 | ), |
| 8 | 8 | ); |
| 9 | 9 | \ No newline at end of file |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | 'category' => '', |
| 29 | 29 | //'cache_type' => 0,//bool |
| 30 | 30 | //content: 'snippet', plugincode |
| 31 | - 'description' => '',// 191 |
|
| 31 | + 'description' => '', // 191 |
|
| 32 | 32 | 'editor_type' => 0, // int? |
| 33 | 33 | 'locked' => 0, // bool |
| 34 | 34 | 'name' => '', |
| 35 | - 'property_preprocess' => 0,// bool |
|
| 36 | - 'properties' => '',//?? |
|
| 35 | + 'property_preprocess' => 0, // bool |
|
| 36 | + 'properties' => '', //?? |
|
| 37 | 37 | 'source' => 1, |
| 38 | 38 | 'static' => 0, |
| 39 | 39 | 'static_file' => '' |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @param bool $overwrite_static ~ if the setAsStatic is ran, false will keep the static content code, true will overwrite the static file |
| 114 | 114 | * @return $this |
| 115 | 115 | */ |
| 116 | - public function setFieldCode($code, $overwrite_static=false) |
|
| 116 | + public function setFieldCode($code, $overwrite_static = false) |
|
| 117 | 117 | { |
| 118 | 118 | $this->blendable_xpdo_simple_object_data['content'] = $code; |
| 119 | 119 | $this->overwrite_static = $overwrite_static; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @param bool $overwrite_static ~ if the setAsStatic is ran, false will keep the static content code, true will overwrite the static file |
| 127 | 127 | * @return $this |
| 128 | 128 | */ |
| 129 | - public function setFieldContent($code, $overwrite_static=false) |
|
| 129 | + public function setFieldContent($code, $overwrite_static = false) |
|
| 130 | 130 | { |
| 131 | 131 | return $this->setFieldCode($code, $overwrite_static); |
| 132 | 132 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * |
| 177 | 177 | * @return $this |
| 178 | 178 | */ |
| 179 | - public function setAsStatic($file, $media_source='Filesystem') |
|
| 179 | + public function setAsStatic($file, $media_source = 'Filesystem') |
|
| 180 | 180 | { |
| 181 | 181 | $this->blendable_xpdo_simple_object_data['source'] = $media_source; |
| 182 | 182 | $this->blendable_xpdo_simple_object_data['static'] = true; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * |
| 255 | 255 | * @return string |
| 256 | 256 | */ |
| 257 | - public function seedCategory($category_id=0) |
|
| 257 | + public function seedCategory($category_id = 0) |
|
| 258 | 258 | { |
| 259 | 259 | $categories = $this->blender->getCategoryMap(); |
| 260 | 260 | if (isset($categories['ids'][$category_id]) && isset($categories['ids'][$category_id]['lineage'])) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param Blender $blender |
| 41 | 41 | * @param string $key ~ the context key |
| 42 | 42 | */ |
| 43 | - public function __construct(\modx $modx, Blender $blender, $key='') |
|
| 43 | + public function __construct(\modx $modx, Blender $blender, $key = '') |
|
| 44 | 44 | { |
| 45 | 45 | $this->setFieldKey($key); |
| 46 | 46 | parent::__construct($modx, $blender, $key); |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | * @param string $type ~ seed or revert |
| 72 | 72 | * @return string |
| 73 | 73 | */ |
| 74 | - public function getSeedKey($type='seed') |
|
| 74 | + public function getSeedKey($type = 'seed') |
|
| 75 | 75 | { |
| 76 | 76 | $name = $this->getFieldKey(); |
| 77 | 77 | $key = $this->blender->getSeedKeyFromName($name); |
| 78 | 78 | |
| 79 | 79 | switch ($type) { |
| 80 | 80 | case 'revert': |
| 81 | - $seed_key = 'revert-' . $key; |
|
| 81 | + $seed_key = 'revert-'.$key; |
|
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case 'seed': |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @param string $namespace |
| 156 | 156 | * @return $this |
| 157 | 157 | */ |
| 158 | - public function addSetting($key, $value, $xtype='textfield', $area='', $namespace='core') |
|
| 158 | + public function addSetting($key, $value, $xtype = 'textfield', $area = '', $namespace = 'core') |
|
| 159 | 159 | { |
| 160 | 160 | // @TODO how to use the SystemSetting class to make blendable context settings and IDE helpers |
| 161 | 161 | $this->related_data['settings'][] = [ |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | * |
| 38 | 38 | * @return $this |
| 39 | 39 | */ |
| 40 | - public function attachToTemplate($template_name, $rank=0) |
|
| 40 | + public function attachToTemplate($template_name, $rank = 0) |
|
| 41 | 41 | { |
| 42 | 42 | $this->template_names[] = [ |
| 43 | 43 | 'name' => $template_name, |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | */ |
| 812 | 812 | protected function assignResourceGroups() |
| 813 | 813 | { |
| 814 | - $new_groups = (isset($this->related_data['resource_groups']) ? $this->related_data['resource_groups'] : [] ); |
|
| 814 | + $new_groups = (isset($this->related_data['resource_groups']) ? $this->related_data['resource_groups'] : []); |
|
| 815 | 815 | |
| 816 | 816 | // resource groups |
| 817 | 817 | $current_groups = $this->xPDOSimpleObject->getResourceGroupNames(); |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | * |
| 845 | 845 | * @return bool|\modResource |
| 846 | 846 | */ |
| 847 | - public function getResourceFromSeedKey($seed_key, $context='web') |
|
| 847 | + public function getResourceFromSeedKey($seed_key, $context = 'web') |
|
| 848 | 848 | { |
| 849 | 849 | // get the alias: |
| 850 | 850 | $alias = $this->blender->getAliasFromSeedKey($seed_key); |
@@ -856,13 +856,13 @@ discard block |
||
| 856 | 856 | * @param string $type ~ seed or revert |
| 857 | 857 | * @return string |
| 858 | 858 | */ |
| 859 | - public function getSeedKey($type='seed') |
|
| 859 | + public function getSeedKey($type = 'seed') |
|
| 860 | 860 | { |
| 861 | 861 | $key = $this->blender->getSeedKeyFromAlias($this->blendable_xpdo_simple_object_data['alias']); |
| 862 | 862 | |
| 863 | 863 | switch ($type) { |
| 864 | 864 | case 'revert': |
| 865 | - $seed_key = 'revert-' . $key; |
|
| 865 | + $seed_key = 'revert-'.$key; |
|
| 866 | 866 | break; |
| 867 | 867 | |
| 868 | 868 | case 'seed': |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | /** @var \modResource $this->xPDOSimpleObject */ |
| 907 | 907 | $this->xPDOSimpleObject; |
| 908 | 908 | // no IDs only TV name |
| 909 | - $tvs = [];// TemplateVarResources modTemplateVarResource |
|
| 909 | + $tvs = []; // TemplateVarResources modTemplateVarResource |
|
| 910 | 910 | |
| 911 | 911 | $template = false; |
| 912 | 912 | $resource_groups = []; |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | $type = false; |
| 956 | 956 | |
| 957 | 957 | // These are set via system settings: |
| 958 | - if (isset($this->portable_template_variables[$tv_name]) ) { |
|
| 958 | + if (isset($this->portable_template_variables[$tv_name])) { |
|
| 959 | 959 | return $this->portable_template_variables[$tv_name]; |
| 960 | 960 | } |
| 961 | 961 | |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | // @TODO throw exception |
| 1031 | 1031 | return 0; |
| 1032 | 1032 | } |
| 1033 | - return (int) $this->blender->getResourceIDFromSeedKey( |
|
| 1033 | + return (int)$this->blender->getResourceIDFromSeedKey( |
|
| 1034 | 1034 | $parent['seed_key'], |
| 1035 | 1035 | $parent['context'] |
| 1036 | 1036 | ); |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | $tag_columns[$name] = $value; |
| 1192 | 1192 | } |
| 1193 | 1193 | } |
| 1194 | - if ( !isset($tags[$tag['group_name']])) { |
|
| 1194 | + if (!isset($tags[$tag['group_name']])) { |
|
| 1195 | 1195 | $tags[$tag['group_alias']] = [ |
| 1196 | 1196 | 'columns' => $group_columns, |
| 1197 | 1197 | 'tags' => [] |
@@ -1208,7 +1208,7 @@ discard block |
||
| 1208 | 1208 | * @param \modResource $resource |
| 1209 | 1209 | * @param array $tags |
| 1210 | 1210 | */ |
| 1211 | - protected function setResourceTags(\modResource $resource, $tags=[]) |
|
| 1211 | + protected function setResourceTags(\modResource $resource, $tags = []) |
|
| 1212 | 1212 | { |
| 1213 | 1213 | $tagger_groups = []; |
| 1214 | 1214 | |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | * @param Blender $blender |
| 82 | 82 | * @param string|array $unique_value |
| 83 | 83 | */ |
| 84 | - public function __construct(\modx $modx, Blender $blender, $unique_value='') |
|
| 84 | + public function __construct(\modx $modx, Blender $blender, $unique_value = '') |
|
| 85 | 85 | { |
| 86 | 86 | $this->modx = $modx; |
| 87 | 87 | $this->blender = $blender; |
| 88 | - if (method_exists($this, 'loadProperties') ) { |
|
| 88 | + if (method_exists($this, 'loadProperties')) { |
|
| 89 | 89 | $this->loadProperties(); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function setSeedsDir($dir) |
| 136 | 136 | { |
| 137 | - $this->seeds_dir = (string) $dir; |
|
| 137 | + $this->seeds_dir = (string)$dir; |
|
| 138 | 138 | if (!empty($this->seeds_dir)) { |
| 139 | - $this->cacheOptions[\xPDO::OPT_CACHE_PATH] = $this->blender->getSeedsPath() . $dir . '/'; |
|
| 139 | + $this->cacheOptions[\xPDO::OPT_CACHE_PATH] = $this->blender->getSeedsPath().$dir.'/'; |
|
| 140 | 140 | } |
| 141 | 141 | return $this; |
| 142 | 142 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | * @param string $type ~ seed or revert |
| 170 | 170 | * @return string |
| 171 | 171 | */ |
| 172 | - public function getSeedKey($type='seed') |
|
| 172 | + public function getSeedKey($type = 'seed') |
|
| 173 | 173 | { |
| 174 | 174 | $name = $this->blendable_xpdo_simple_object_data[$this->unique_key_column]; |
| 175 | 175 | if (method_exists($this, 'getFieldName')) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | switch ($type) { |
| 181 | 181 | case 'revert': |
| 182 | - $seed_key = 'revert-' . $key; |
|
| 182 | + $seed_key = 'revert-'.$key; |
|
| 183 | 183 | break; |
| 184 | 184 | |
| 185 | 185 | case 'seed': |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * @param bool $overwrite |
| 205 | 205 | * @return bool |
| 206 | 206 | */ |
| 207 | - public function blendFromArray($data, $overwrite=false) |
|
| 207 | + public function blendFromArray($data, $overwrite = false) |
|
| 208 | 208 | { |
| 209 | 209 | if (isset($data['columns'])) { |
| 210 | 210 | $this->blendable_xpdo_simple_object_data = $data['columns']; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | * |
| 230 | 230 | * @return bool |
| 231 | 231 | */ |
| 232 | - public function blendFromSeed($seed_key, $overwrite=false) |
|
| 232 | + public function blendFromSeed($seed_key, $overwrite = false) |
|
| 233 | 233 | { |
| 234 | 234 | $this->loadObjectDataFromSeed($seed_key); |
| 235 | 235 | return $this->blend($overwrite); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | * |
| 241 | 241 | * @return bool |
| 242 | 242 | */ |
| 243 | - public function blend($overwrite=false) |
|
| 243 | + public function blend($overwrite = false) |
|
| 244 | 244 | { |
| 245 | 245 | if ($this->type == 'blend') { |
| 246 | 246 | /** @var \LCI\Blend\Blendable\Blendable $currentVersion */ |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * @param bool $make_revert_seed |
| 286 | 286 | * @return bool |
| 287 | 287 | */ |
| 288 | - public function delete($make_revert_seed=true) |
|
| 288 | + public function delete($make_revert_seed = true) |
|
| 289 | 289 | { |
| 290 | 290 | if ($make_revert_seed) { |
| 291 | 291 | $this->seed('revert'); |
@@ -295,13 +295,13 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | $this->onDeleteRevertRelatedPieces(); |
| 297 | 297 | if ($this->isDebug()) { |
| 298 | - $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column] . ' has been removed/deleted'); |
|
| 298 | + $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' has been removed/deleted'); |
|
| 299 | 299 | } |
| 300 | 300 | $removed = true; |
| 301 | 301 | |
| 302 | 302 | } else { |
| 303 | 303 | if ($this->isDebug()) { |
| 304 | - $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column] . ' did not remove/delete', true); |
|
| 304 | + $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' did not remove/delete', true); |
|
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @param string $type ~ seed or revert |
| 327 | 327 | * @return string ~ the related seed key |
| 328 | 328 | */ |
| 329 | - public function seed($type='seed') |
|
| 329 | + public function seed($type = 'seed') |
|
| 330 | 330 | { |
| 331 | 331 | $data = false; |
| 332 | 332 | // No IDs! must get the alias and get a seed key, |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | * @param string $seed_key |
| 351 | 351 | * @return array |
| 352 | 352 | */ |
| 353 | - public function seedToArray($type='seed', $seed_key='') |
|
| 353 | + public function seedToArray($type = 'seed', $seed_key = '') |
|
| 354 | 354 | { |
| 355 | 355 | if (is_object($this->xPDOSimpleObject)) { |
| 356 | 356 | $this->current_xpdo_simple_object_data = $this->xPDOSimpleObject->toArray(); |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | // Any child class can create a seed method, an example for modResource: |
| 363 | 363 | // seedTemplate(1) and would return the string name |
| 364 | - $method = 'seed' . $this->makeStudyCase($column); |
|
| 364 | + $method = 'seed'.$this->makeStudyCase($column); |
|
| 365 | 365 | if (method_exists($this, $method)) { |
| 366 | 366 | $value = $this->$method($value); |
| 367 | 367 | } |
@@ -417,15 +417,15 @@ discard block |
||
| 417 | 417 | * |
| 418 | 418 | * @return bool |
| 419 | 419 | */ |
| 420 | - protected function save($overwrite=false) |
|
| 420 | + protected function save($overwrite = false) |
|
| 421 | 421 | { |
| 422 | 422 | $saved = false; |
| 423 | 423 | |
| 424 | 424 | if (is_object($this->xPDOSimpleObject)) { |
| 425 | 425 | if (!$overwrite) { |
| 426 | 426 | $this->error = true; |
| 427 | - $this->error_messages['exits'] = $this->xpdo_simple_object_class.': ' . |
|
| 428 | - $this->blendable_xpdo_simple_object_data[$this->unique_key_column] . ' already exists '; |
|
| 427 | + $this->error_messages['exits'] = $this->xpdo_simple_object_class.': '. |
|
| 428 | + $this->blendable_xpdo_simple_object_data[$this->unique_key_column].' already exists '; |
|
| 429 | 429 | return $saved; |
| 430 | 430 | } |
| 431 | 431 | } else { |
@@ -453,13 +453,13 @@ discard block |
||
| 453 | 453 | if ($this->xPDOSimpleObject->save()) { |
| 454 | 454 | $this->attachRelatedPiecesAfterSave(); |
| 455 | 455 | if ($this->isDebug()) { |
| 456 | - $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column] . ' has been installed/saved'); |
|
| 456 | + $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' has been installed/saved'); |
|
| 457 | 457 | } |
| 458 | 458 | $saved = true; |
| 459 | 459 | |
| 460 | 460 | } else { |
| 461 | 461 | if ($this->isDebug()) { |
| 462 | - $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column] . ' did not install/update', true); |
|
| 462 | + $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' did not install/update', true); |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | } |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | * |
| 507 | 507 | * @return $this |
| 508 | 508 | */ |
| 509 | - protected function loadFromArray($data=[]) |
|
| 509 | + protected function loadFromArray($data = []) |
|
| 510 | 510 | { |
| 511 | 511 | foreach ($data as $column => $value) { |
| 512 | 512 | $method_name = 'seed'.$this->makeStudyCase($column); |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | $this->$method_name($value); |
| 536 | 536 | |
| 537 | - } elseif($this->isDebug()) { |
|
| 537 | + } elseif ($this->isDebug()) { |
|
| 538 | 538 | $this->blender->out(__METHOD__.' missing: '.$method_name.' V: '.$value, true); |
| 539 | 539 | } |
| 540 | 540 | } |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | /** |
| 624 | 624 | * @var string $type blend or revert |
| 625 | 625 | */ |
| 626 | - protected function seedRelated($type='blend') |
|
| 626 | + protected function seedRelated($type = 'blend') |
|
| 627 | 627 | { |
| 628 | 628 | // load related data: |
| 629 | 629 | $this->loadRelatedData(); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @return $this |
| 127 | 127 | */ |
| 128 | - public function attachTemplateVariable($tv_name, $rank=0) |
|
| 128 | + public function attachTemplateVariable($tv_name, $rank = 0) |
|
| 129 | 129 | { |
| 130 | 130 | if (!isset($this->related_data['attach'])) { |
| 131 | 131 | $this->related_data['attach'] = []; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | /** |
| 225 | 225 | * @var string $type blend or revert |
| 226 | 226 | */ |
| 227 | - protected function seedRelated($type='blend') |
|
| 227 | + protected function seedRelated($type = 'blend') |
|
| 228 | 228 | { |
| 229 | 229 | // get all related TVs: |
| 230 | 230 | $tv_keys = []; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | 'name' => $tv_name, |
| 245 | 245 | 'rank' => $tvTemplate->get('rank') |
| 246 | 246 | ]; |
| 247 | - $this->blender->out('TV ' . $tv_name . ' has been seeded: ' . $seed_key); |
|
| 247 | + $this->blender->out('TV '.$tv_name.' has been seeded: '.$seed_key); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | $this->related_data['seeds'] = $tv_keys; |