How to disable Edit/Hide/Delete in TCA for TYPO3 Extbase Domain Model? - typo3

As the title already says, I want to make a specific Extbase domain-model completely "read only" .. It is a custom Log-Entry model that shall be viewable but must not be modified via backend (they are being generated during certain controller actions).
I do not use the TYPO3 log system intentionally, because I want to have a separate log with its own db-table etc.
I do know about the readOnly property for columns, but I`d like to disable any modification-functions in the list view also.
Thanks in advance, Oliver

There's not only option "readOnly" for columns, this option can also be set for the whole table:
$GLOBALS['TCA']['yourTable']['ctrl']['readOnly'] = 1;
Have a look at EXT:static_info_tables, the records from this extension are not editable.

Related

Typo3 9.5 : Add a new field to a new page type

I make a new page type with the help of this doc : https://docs.typo3.org/m/typo3/reference-coreapi/9.5/en-us/ApiOverview/PageTypes/
I want now to customize it by adding a new field to my page
For example a field under "title" field
I checked the doc and didn't find how to do this
Some one can explain me how to custom my new page please?
Thanks
extending pages records is the same than extending tt_contentrecords.
there is a an example to this in the documentation: extend tt_content and use data processing.
This link is to the documentation of TYPO3 11 as this version is state of the art and gets support. For older versions the declarations may vary a little, but the concept is the same:
add new fields in database and TCA.
create a variant (type) and declare which fields should be shown for this variant.
you may need additional getter and setter or controller for this variant

typo3 tx-news create a custom record type

i know how to create new news types thats stated here https://docs.typo3.org/p/georgringer/news/main/en-us/Tutorials/ExtendNews/AddCustomType/Index.html
But is it possible to extend it so that i can make a complete unique record type?
For example:
I want something like: "News Tag 2" - so a different type of record with different fields i can save.
Is that possible?
Thank you.
You can do that by writing your own extension which contains the new type as Exbase model. Then you can attach it to the news record by extending the news domain model

TYPO3 Extension Builder Integrate of existing table

I tried to integrate an existing table to my extension. The problem is that the content of the table isn't taken over.
I created a new model with the name of the existing table and named the properties according to the existing column names. I also implemented the corresponding getters and setters of the properties.
Extension
The name of the existing table is tx_institutsseminarverwaltung_domain_model_event.
How are you trying to "consume" or access the data from the other table in your extension?
Do you have a repository for the existing table (maybe there is already an existing repository, that you can reuse)?
See german typo3 board mapping existing tables and SO thread TYPO3 / How to make repository from existing table fe_users?
This question is most likely a duplicate of this question
The solution for this issues is:
First get the Typo3 query settings
$querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
Set RespectStoragePage to false
$querySettings->setRespectStoragePage(FALSE);
Fetch your repository
$theRepository = $this->objectManager->get('TYPO3\\institutsseminarverwaltung\\Domain\\Repository\\EventRepository');
And set the query settings to your repository.
$theRepository->setDefaultQuerySettings($querySettings);

Combine fields from two tables into one autocompletebox

I have two tables "Services and Projects". Both tables have a "Name" field. I would like to take both fields from both the tables and put them into a single autocompletebox in one of my screens. I searched around and found different methods of doing this but not in LightSwitch. Any ideas?
If I understand your requirement correctly, you want the Name property from both Services and Projects to appear in a single textbox? If this is the case, my approach would be as follows:
Use a view on the data source to union the Projects and Services data sources
Add that view to your data model (on a new data connection)
Define Name as the summary property for the new view-based entity.
Add the view to your screen as a separate query
Add the view data object to your screen as an auto-complete box.
WARNING: You'll also need code-behind to identify whether the value selected is a Project or a Service and to apply this value to the relevant field in your linked entity.

Symfony2 - the good way to add an image in our entity

Actually I have a "Movie" entity and I want to add a new attribute like "picture". Of course I have to add this attribute in my entity "Movie".
But I was wondering if I have to set some parameters like size, extension in my mapping comments.
Then, as I have not created yet my add for and edit form... I add manually datas in my database for testing my scripts.
Does the "picture" column contain only the name of the image like "toto.png" ?
If it's the case, what is the directory which will save the images ?
Assuming you use Doctrine as ORM, I suggest reading up on file uploads in the Symfony documentation. It describes the fields to create, form and upload handling. But yes, you basically store the filename in the field "picture" and create additional functions to help figure out the true path to the file.