Blog
- Details
- Written by R. Elizondo
- Category: Symfony Framework
Doctrine's Object Relational Mapper and the Entity classes provide us developers a very easy way to deal with Table associations. When we define a One To Many / Many To One Table association, the best way to query results is from the One To Many side.
Before you continue reading, you may want to check on this previous posts:
- How to implement One to Many Relation in Symfony with Doctrine in easy steps
- How to Implement Many to Many Relation in Symfony with Doctrine in easy steps
Lets suppose you have a Customers Entity. Each Customer has many bills associated to it:
Read more: How to get Sorted results from a To Many Relation in Symfony Entity
- Details
- Written by R. Elizondo
- Category: Virtualization
Once you have up and running Vagrant and VirtualBox in your machine you need to follow these steps to create a VM and install all necessary dependencies to run PHP Projects.
UPDATE: I have updated the vagrant file to use CentOS 9 Stream so we can install newer versions of PHP and NodeJs
Prerequisites:
Step 1. Go to the Directory where you have the Vagrantfile and then execute
$ vagrant suspend
this will stop the VM if it is running.
Read more: Vagrant Virtual Machine with CentOS 7, Nginx, MariaDb, NodeJs and PHP 8
- Details
- Written by R. Elizondo
- Category: Virtualization
Docker has revolutionized containerization and simplified the deployment of applications. However, as your Docker environment grows, it's crucial to maintain cleanliness and remove unnecessary components to free up disk space and improve performance.
Here are the steps to guide you through the process of removing Docker images, containers, volumes, and networks, ensuring an efficient and streamlined Docker setup.
Before diving into the cleanup process, ensure that you have the following prerequisites in place:
1. Docker installed and configured on your system.
2. Sufficient permissions to manage Docker resources.
3. Basic familiarity with the Docker command-line interface (CLI).
Removing Docker Images:
Over time, unused or outdated Docker images can accumulate on your system, consuming valuable disk space.
To remove them, follow these steps:
- a. List all Docker images using the command docker images -a.
b. Identify the images you want to remove by their repository and tag.
c. Execute the command docker rmi <image_id> for each image you wish to delete.
Deleting Docker Containers:
Read more: Efficient Docker Cleanup: Removing Images, Containers, Volumes, and Networks
- Details
- Written by R. Elizondo
- Category: Symfony Framework
MostPHP Software Applications require to provide the user the capability of uploading images, pdf and other types of documents. With Symfony, this implementation is very easy and simple, just follow this recipe:
Prerequisites:
Step 1. Create a form in your Symfony application to allow file uploads. You can use Symfony's Form component or directly create an HTML form.
Define the form fields including the file input field. For example, using Symfony's Form component, you can define a file field like this:
use Symfony\Component\Form\Extension\Core\Type\FileType;
// ...
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// other form fields
->add('file', FileType::class)
// ...
;
}
Page 14 of 42