mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:29:03 -05:00 
			
		
		
		
	Add key for activities
This commit is contained in:
		
							parent
							
								
									1dddc6d103
								
							
						
					
					
						commit
						ad5b185c7c
					
				@ -83,6 +83,11 @@ class Activity extends Eloquent
 | 
			
		||||
        return $this->belongsTo('App\Models\Task')->withTrashed();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function key()
 | 
			
		||||
    {
 | 
			
		||||
        return sprintf('%s-%s-%s', $this->activity_type_id, $this->client_id, $this->created_at->timestamp);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return mixed
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -22,6 +22,7 @@ class ActivityTransformer extends EntityTransformer
 | 
			
		||||
    public function transform(Activity $activity)
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
            'id' => $activity->key(),
 | 
			
		||||
            'activity_type_id' => $activity->activity_type_id,
 | 
			
		||||
            'client_id' => $activity->client->public_id,
 | 
			
		||||
            'user_id' => $activity->user->public_id + 1,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user