Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message Thread entity relationship #14

Open
JDGrimes opened this issue Nov 23, 2016 · 1 comment
Open

Message Thread entity relationship #14

JDGrimes opened this issue Nov 23, 2016 · 1 comment

Comments

@JDGrimes
Copy link
Member

When introducing the message entity in #1, we considered the possibility of a message thread entity relationship. Somehow I didn't end up discussing it at all in the ticket though. I'm not sure if it would really be useful or not, but I wanted to note that I'd created this class for it, if we ever revisit this:

<?php

/**
 * Message thread entity relationship class.
 *
 * @package WordPoints_BuddyPress
 * @since 1.0.0
 */

/**
 * Defines the relationship between a message and the thread it is a part of.
 *
 * @since 1.0.0
 */
class WordPoints_BP_Entity_Message_Thread
	extends WordPoints_Entity_Relationship_Stored_Field {

	/**
	 * @since 1.0.0
	 */
	protected $storage_type = 'db';

	/**
	 * @since 1.0.0
	 */
	protected $primary_entity_slug = 'bp_message';

	/**
	 * @since 1.0.0
	 */
	protected $related_entity_slug = 'bp_message_thread';

	/**
	 * @since 1.0.0
	 */
	protected $related_ids_field = 'thread_id';

	/**
	 * @since 1.0.0
	 */
	public function get_title() {
		return __( 'Thread', 'wordpoints-bp' );
	}
}

// EOF
@JDGrimes
Copy link
Member Author

I think possibly that the decision had to do with the fact that we don't support array targets. But I'm not 100% sure. We may have just concluded that it wasn't worth pursuing in general because it wouldn't be very useful. Possibly there were other technical difficulties encountered, but I don't recall at the moment. At any rate, I don't feel compelled to pursue this in 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant