0
votes

I want to delete all data in one channel. And I found that, the best way to delete all entry in channel is delete this channel and re-create it follow this article: https://expressionengine.stackexchange.com/questions/7648/what-is-the-best-way-to-delete-every-entry-in-a-channel

and I tried to delete channel follow this article: http://ellislab.com/expressionengine/user-guide/development/api/api_channel_structure.html

I know that the site_id is 1 and the channel_id of channel I need to delete is 1. But when I tried these code:

ee()->load->library('api'); ee()->api->instantiate('channel_structure');
$channel_id = 1;$site_id = 1;
ee()->api_channel_structure->delete_channel((int) $channel_id, [(int) $site_id]);

I got this error:

Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/au/admin/expressionengine/libraries/Functions.php(679) : eval()'d code on line 7

I tried with:

ee()->api_channel_structure->delete_channel((int) 1, [(int) 1]);
ee()->api_channel_structure->delete_channel(1, 1);

But got same issue.

Does somebody know how to solve this issue. Thank so much!

2
If you are not getting the response you are hoping for here I'd suggest you post on the dedicated EE site: expressionengine.stackexchange.com - AllInOne

2 Answers

0
votes

In the EE documentation (int) is an indication that the expected value is an integer. Also, the documentation convention is that square brackets indicate optional values.

Neither is meant to be part of the code if I am reading it correctly. I think this is what you want:

ee()->load->library('api');
ee()->api->instantiate('channel_structure');
$channel_id = 1;
$site_id = 1;
ee()->api_channel_structure->delete_channel($channel_id, $site_id);
0
votes

Try adding &perpage=1000 to the end of the query string on the Edit Channel Entries screen...

E.g. /admin.php?S=de47727e64b2e445cfee64c85a219977c9b62474&D=cp&C=content_edit&perpage=1000

If you run out of memory use a lower number.