New field is not saving

Database field “published_on” is not updating in the database.

    App\Model\Entity\News Object
(
    [id] => 1
    [title] => What Is Blockchain technology .
    [description] => What you need to realize is that bitcoin is a currency, an electronic version of an asset, similar to gold. 
    [cover_image] => news/bitcoin-3089728_1920.jpg
    [is_approved] => yes
    [created_by] => 11
    [created_on] => Cake\I18n\FrozenTime Object
        (
            [time] => 2019-08-11T15:00:12+05:30
            [timezone] => Asia/Calcutta
            [fixedNowTime] => 
        )

[published_on] => 2019-08-12 02:03 04
[category] => India
[tags] => #whatisblockchain #howblockchainwork #Founderofbitcoin
[is_deleted] => 
[detail] => 
[[new]] => 
[[accessible]] => Array
    (
        [title] => 1
        [description] => 1
        [cover_image] => 1
        [is_approved] => 1
        [created_by] => 1
        [created_on] => 1
        [category] => 1
        [tags] => 1
        [published_on] => 1
    )

[[dirty]] => Array
    (
        [is_approved] => 1
        [published_on] => 1
    )

[[original]] => Array
    (
        [is_approved] => no
        [published_on] => 
    )

[[virtual]] => Array
    (
    )

[[hasErrors]] => 
[[errors]] => Array
    (
    )

[[invalid]] => Array
    (
    )

[[repository]] => News

)

Why no colon between the minutes and seconds?

You will need to delete all the files from following folder:
“your_app/tmp/cache/models/”
Then run again.

1 Like

You have to check your entity of the table.

Consider, if you are using cakephp 3.*, then each table will have Entity and Table file in your Model.

Ex : users table in database
then Entity/User.php, Entity/UsersTable.php will be created if we run through cake bake.

If you have the User.php
Open the file and check the new field in the accessible function which you created

Its works . Thankyou so much .