src/Entity/Tweet.php
public function mustBeKept($tweetId)
    {
        if (count($this->getRetweetingStatuses()) == 0) {
            // This tweet has not been retweeted
            return false;
        }

        // Check that this tweet has not been retweeted after $tweetId
        foreach ($this->getRetweetingStatuses() as $retweeting_status) {
            // This tweet is retweeted in the timeline, keep it
            if ($retweeting_status->getId() >= $tweetId) {
                return true;
            }
        }

        return false;
    }
public function mustBeKept($tweetId)
    {
        if (count($this->getRetweetingStatuses()) == 0) {
            // This tweet has not been retweeted
            return false;
        }

        // Check that this tweet has not been retweeted after $tweetId
        foreach ($this->getRetweetingStatuses() as $retweeting_status) {
            // This tweet is retweeted in the timeline, keep it
            if ($retweeting_status->getId() >= $tweetId) {
                return true;
            }
        }

        return false;
    }
public function mustBeKept ( $ tweetId ) { if ( count ( $ this -> getRetweetingStatuses ( ) ) == 0 ) { // This tweet has not been retweeted return false ; } // Check that this tweet has not been retweeted after $tweetId foreach ( $ this -> getRetweetingStatuses ( ) as $ retweeting_status ) { // This tweet is retweeted in the timeline, keep it if ( $ retweeting_status -> getId ( ) >= $ tweetId ) { return true ; } } return false ; }
Check that tweet can be deleted.

@param int $tweetId

@return bool
Check that tweet can be deleted .