Home » PHP


Upload image through Pimcore command in the asset folder


Create the command folder in the AppBundle folder. Than create the ImageUploadCommand.php /var/www/html/thebricktest/thebrick/src/AppBundle/Command/ImageUploadCommand.php <?php namespace AppBundle\Command; use Pimcore\Console\AbstractCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use AppBundle\Service\UploadImage; class ImageUploadCommand extends AbstractCommand { protected function configure() { $this ->setName('imageupload:command') ->setDescription('Image upload command'); } protected function execute(InputInterface $input, OutputInterface $output) { $obj = …

Read More »

What is the abstraction in PHP?

Abstraction is the concept of moving the focus from the details and concrete implementation of things, to the types of things (i.e. classes), the operations available (i.e. methods), etc class A { private $isOn = false; public function on() { $this->isOn = true; } public function Off() { $this->isOn = …

Read More »

What is the encapsulation in PHP?

Wrapping some data in single unit is called Encapsulation. Encapsulation is used to safe data or information in an object from other it means encapsulation is mainly used for protection purpose. class A { private $name; public function setName($name) { $this->name = $name; } public function getName($name) { return $this->name; …

Read More »

What is the Polymorphism in PHP?

Polymorphism is one of the PHP Object Oriented Programming (OOP) features. Polymorphism is derived from two Greek words. Poly (meaning many) and morph (meaning forms). In general, polymorphism means the ability to have many forms. In other words, “Polymorphism describes a pattern in Object Oriented Programming in which a class …

Read More »