<commit_before><?php namespace Dmyers\Activity;

// currently unused

class ActivityContainer
{
	protected $activity_id;
	protected $item;
	protected $doer;
	protected $victim;
	protected $action;
	
	public function __construct() {}
	
	public function adapter()
	{
		return $this->adapter;
	}
	
	public function item()
	{
		$this->item = $item;
		return $this;
	}
	
	public function action($action)
	{
		$this->action = $action;
		return $this;
	}
	
	public function doer($doer)
	{
		$this->doer = $doer;
		return $this;
	}
	
	public function victim($victim)
	{
		$this->victim = $victim;
		return $this;
	}
	
	public function find(array $params = array())
	{
		return $this->adapter()->find($params);
	}
	
	public function create()
	{
		$activity_id = $this->adapter()->create(array(
			'doer_id'   => $this->doer->id,
			'item_id'   => $this->item->id,
			'item_type' => get_class($this->item),
		));
		
		$this->activityId($activity_id);
		
		return true;
	}
	
	public function update()
	{
		$activity_id = $this->activity_id;
		
		$updated = $this->adapter()->update($activity_id, array(
			'doer_id'   => $this->doer->id,
			'item_id'   => $this->item->id,
			'item_type' => get_class($this->item),
		));
		
		if ($deleted) {
			return true;
		}
		
		return false;
	}
	
	public function delete()
	{
		$activity_id = $this->activity_id;
		
		$deleted = $this->adapter()->destroy($activity_id);
		
		if ($deleted) {
			return true;
		}
		
		return false;
	}
}<commit_msg>Fixed setting activity id in activity container<commit_after><?php namespace Dmyers\Activity;

// currently unused

class ActivityContainer
{
	protected $id;
	protected $item;
	protected $doer;
	protected $victim;
	protected $action;
	
	public function __construct() {}
	
	public function adapter()
	{
		return $this->adapter;
	}
	
	public function item()
	{
		$this->item = $item;
		return $this;
	}
	
	public function action($action)
	{
		$this->action = $action;
		return $this;
	}
	
	public function doer($doer)
	{
		$this->doer = $doer;
		return $this;
	}
	
	public function victim($victim)
	{
		$this->victim = $victim;
		return $this;
	}
	
	public function find(array $params = array())
	{
		return $this->adapter()->find($params);
	}
	
	public function create()
	{
		$activity_id = $this->adapter()->create(array(
			'doer_id'   => $this->doer->id,
			'item_id'   => $this->item->id,
			'item_type' => get_class($this->item),
		));
		
		$this->setActivityId($activity_id);
		
		return true;
	}
	
	public function update()
	{
		$activity_id = $this->activity_id;
		
		$updated = $this->adapter()->update($activity_id, array(
			'doer_id'   => $this->doer->id,
			'item_id'   => $this->item->id,
			'item_type' => get_class($this->item),
		));
		
		if ($deleted) {
			return true;
		}
		
		return false;
	}
	
	public function delete()
	{
		$activity_id = $this->activity_id;
		
		$deleted = $this->adapter()->destroy($activity_id);
		
		if ($deleted) {
			return true;
		}
		
		return false;
	}
	
	public function setActivityId($id)
	{
		$this->id = $id;
	}
}
{'fraction_non_alphanumeric': 0.16946363935505102, 'fraction_numerical': 0.0, 'mean_word_length': 3.324324324324324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 68, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2389117', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1086, 'n_words': 225}