Jump to content

Topic ID column in topic trait


Go to solution Solved by Ryan Ashbrook,

Recommended Posts

Posted

You are using a hard-coded column name:

	/**
	 * Get the database column which stores the topic ID
	 *
	 * @return	string
	 */
	public static function topicIdColumn()
	{
		return 'topicid';
	}

Can't you use a mapped column from the model to avoid changing files and templates? That happens in apps that uses topics released before the trait.

  • Solution
Posted

Classes using the trait can overload the method if the column name does not match - in this case, the trait is simply providing a default value.

Using mapped() would not work, because the "topic" column isn't actually included in the $databaseColumnMap property.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...