Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
newbie LAC Posted June 28, 2019 Posted June 28, 2019 Hello, I use \IPS\Helpers\Table\Db. Don't tell me use \IPS\Helpers\Table\Custom I only need specific columns In that class you have ( \count( $selects ) ) ? $this->table . '.*, ' . implode( ', ', $selects ) : '*' Could you add new property and change above code? For example /** * @brief Select only specific columns */ public $selectColumns = NULL; and $this->selectColumns ?? ( ( \count( $selects ) ) ? $this->table . '.*, ' . implode( ', ', $selects ) : '*' )
Daniel F Posted June 28, 2019 Posted June 28, 2019 I have raised an internal suggestion. I haven’t looked at it yet, but we have already the include property there, which could probably be used here, without introducing a new property for this.
newbie LAC Posted June 28, 2019 Author Posted June 28, 2019 5 minutes ago, Daniel F said: but we have already the include property there, which could probably be used here, without introducing a new property for this. include works with results I have several resources where I added new elements (which are not tables columns) to results array You also have For example member devices $table = new \IPS\Helpers\Table\Db( 'core_members_known_devices', \IPS\Http\Url::internal("app=core&module=members&controller=devices&do=member&id={$member->member_id}"), array( 'member_id=?', $member->member_id ) ); $table->langPrefix = 'device_table_'; $table->include = array( 'user_agent', 'login_key', 'login_handler', 'last_seen', 'other_members' ); other_members not table column
Recommended Posts
Archived
This topic is now archived and is closed to further replies.