-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing SuluMedia Bundle Configurations #624
Comments
A little bit offtopic. |
We dont have a lot of documentation about custom entities at the moment, so not sure what would be the best place for this. Would be okay for me to add a |
We had something similar one a project documentation there was a section |
Docs did there look like this: ## Override Entities
### Override Media Entity
Create your new product entity class:
```php
<?php
// src/Entity/Product.php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use .......\Media as SuluMedia;
/**
* @ORM\Table(name="me_media")
* @ORM\Entity
*/
class Media extends SuluMedia
{
}
```
Configure your new model class:
```yaml
# config/packages/sulu_product.yaml
sulu_media:
objects:
media:
model: 'App\Entity\Media'
```
To add new fields to your entity have a look at the [Doctrine Mapping Documentation](https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/basic-mapping.html); |
@alexander-schranz I meant more the direction of bring the Media Bundle into your own Entity. And the doc should contain how about doctrine config (yml or xml) establishes this relationship. Another part should be how you can show the media in your ListView. |
Oh yeah then |
In #623 we added some configuration to the doc. We should also add the other available options to the configuration docs.
The text was updated successfully, but these errors were encountered: